Faker.js helpers#

Mockoon implements Faker.js v7.6.0 library by wrapping most of the available helpers. Faker.js offers lots of helpers: address.zipCode, address.city, address.cityPrefix, name.firstName, name.lastName, datatype.number, datatype.float, internet.avatar, internet.email, etc. Please have a look at Faker.js documentation to learn how to use them.


All Faker.js helpers must be used with the following syntax: {{faker 'namespace.method'}}. Examples:

{{faker 'address.zipCode'}} {{faker 'address.city'}} {{faker 'address.cityPrefix'}} {{faker 'name.firstName'}} ...

Faker.js methods may use two different ways of passing parameters: ordered arguments or options objects. Wrapped in Handlebars helpers, this may result in two different ways of using them:

// named parameters {{faker 'datatype.number' min=0 max=25}} // ordered arguments (here count=25) {{faker 'random.alphaNumeric' 25}}

Set Faker.js' locale and seed#

Faker.js locale and seed can be defined in the settings:

fakerjs settings

📝A note on Faker.js seeding
By providing a seed value, you can generate repeatable sequences of fake data. Using seeding will not always generate the same value but rather a predictable sequence.