0.0.4 • Published 7 years ago

handlebars-faker v0.0.4

Weekly downloads
53
License
MIT
Repository
-
Last release
7 years ago

handlebars-faker

Build Status npm version Dependency Status

Small helper to use faker inside your handlebars template

For a full list of all available fakes see https://github.com/marak/Faker.js/

Installation

npm install handlebars-faker --save-dev

Usage

var Handlebars = require('handlebars');
var FakerHandlebarsHelper = require('handlebars-faker');
Handlebars.registerHelper('faker', FakerHandlebarsHelper);

var template = Handlebars.compile('{{faker "internet.email"}} - {{faker "lorem.words" 3}} - {{faker "random.number" min=4 max=15}}');
console.log(template({}));
// -> Patricia_Schamberger75@gmail.com - voluptas in omnis - 11

Snapshot testing

Snapshot testing requires always the same outcome. To achieve this you can set a random seed:

Usage

var FakerHandlebarsHelper = require('handlebars-faker');
Faker.setRandomSeed(42);

Changelog

Take a look at the CHANGELOG.md.

Contribution

You're free to contribute to this project by submitting issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests. This project uses the semistandard code style.

License

This project is licensed under MIT.

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

8 years ago