Skip to content

Open Faker for custom/community modules #704

@xDivisionByZerox

Description

@xDivisionByZerox

Clear and concise description of the problem

Faker has many different modules but even more requested features.
Many of these features are sadly too complex to be maintained by the Faker-JS team.

Suggested solution

The Faker class should accept a list of modules that will be used under the created Faker instance. These modules will be plugins maintained by the community.
Like:

const myModule = {
    test() {
        return 'test';
    }
}

const fakerWithCustomModule = new Faker({
    customModules: [
        { name: 'testModule', module: myModule },
    ],
});
fakerWithCustomModule.testModule.test(); // 'test'

Alternative

No response

Additional context

Somewhat related to #444

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions