https://github.com/zeropaper/fixturer
A small module to generate fixtures
https://github.com/zeropaper/fixturer
Last synced: 4 months ago
JSON representation
A small module to generate fixtures
- Host: GitHub
- URL: https://github.com/zeropaper/fixturer
- Owner: zeropaper
- License: mit
- Created: 2014-03-19T05:58:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-03-07T10:45:20.000Z (over 11 years ago)
- Last Synced: 2025-09-21T11:40:03.089Z (9 months ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fixturer
========
A small module to generate fixtures
## Installation
The project is not yet in the npm registry but you can install it as follow
```sh
npm install --save-dev zeropaper/fixturer
```
## Usage
Can be used as a tool-belt
```js
var fixturer = require('fixturer');
var randomInterger = fixturer.random(3, 10);
```
or with a JSON definition.
```js
var json = {
"id": "<%= uuid() %>",
"name": {
"first": "<%= personeName(true, false, false) %>",
"last": "<%= personeName(false, true, false) %>",
"middle": "<%= personeName(false, false, true) %>"
}
};
fixturer(json);
```
It should be possible to use it in a browser.. but... I didn't test it.
## Methods
### loremIpsum
Generate a random text
### random
### randomItem
### randomString
### randomDate
### evilScript
### evilLink
### personName
Person name generation
__Params__
* {bool} first - if strictly `false`, no first name part
* {bool} last - if strictly `false`, no last name part
* {bool} middle - if truthy, adds a middle name part
* {string} gender - can be 'male', 'female', random if not defined
(I know it's a bit limited)
### thingName
Thing name generation
__Params__
* {int} count - the number of words used
## License
The MIT License (MIT)