ember-fakerjs
v1.0.0
Published
Faker.js template helpers for Ember.
Downloads
38
Maintainers
Readme
ember-fakerjs
Faker.js template helpers.
This addon provides helpers that can assist with adding fake/fixture data to your applications. This can be especially useful when scaffolding your application or building demos.
Installation
ember install ember-fakerjs
Demo
Usage
Helpers
The list of helpers available are:
faker-fake
use this to generate content by directly using thefaker
APIfaker-random
utility that provides parameterized access to therandom
subsection of thefaker
APIfaker-text
,faker-sentence
,faker-sentences
- generate lorem content
Example usage:
{{faker-random "number" max=100}}
{{faker-random "arrayelement" array("Link" "Ganon" "Zelda")}}
{{faker-sentence 10}} {{!-- create a 10-word sentence --}}
{{faker-sentences 5}} {{!-- create a 5-sentence string --}}
<img src={{faker-fake "{{image.avatar}}"}} alt="avatar">
<a href={{concat "mailto:" (faker-fake "{{internet.email}}")}}>Send Email!</a>
{{faker-fake "{{name.lastName}}, {{name.firstName}} {{name.suffix}}"}}
{{faker-text 10}} {{!-- create a random variation of lorem that repeats 10 times --}}
ES6
This addon provides the ability to import faker as an ES6 module.
import faker from "faker";
Compatibility
- Ember.js v3.20 or above
- Node.js v12 or above
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.