Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tornqvist/jazzon-faker
Generate fake data using faker
https://github.com/tornqvist/jazzon-faker
Last synced: about 1 month ago
JSON representation
Generate fake data using faker
- Host: GitHub
- URL: https://github.com/tornqvist/jazzon-faker
- Owner: tornqvist
- Created: 2015-09-24T09:58:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-24T11:18:23.000Z (over 9 years ago)
- Last Synced: 2024-11-16T07:20:19.976Z (about 1 month ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jazzon-faker
> Generate fake data using faker
## Installation
```bash
$ npm install --save jazzon-faker
```## Usage
All methods in [faker.js](https://github.com/Marak/Faker.js) are supported using dot notaion.
```javascript
let jazzon = require('jazzon');
let faker = require('jazzon-faker');
let json = {
"id": "@{ random.uuid }",
"name": "@{ name.findName }",
"bio": "@{ lorem.sentences(3) }",
"email": "@{ internet.email }"
};jazzon
.use(faker())
.compile(json)
.then(result => console.log(result));/* Logs:
{
"id": "7abd8062-217a-4ea7-a315-569642114293",
"name": "Gerry Ankunding",
"bio": "Suscipit ut atque.\nCorporis dolores officia ipsum cupiditate eius labore.\nAperiam porro ipsam cupiditate officia odit assumenda.",
"email": "[email protected]"
}
*/
```### Conflicting helper names
To avoid conflict with other helpers one can prefix all the mehods with "faker".
```
name.findName === faker.name.findName
```## Options
To set the locale of faker, supply the `locale` option to the plugin.
```javascript
jazzon.use(faker({ locale: 'sv' }));
```