https://github.com/bugthesystem/autopoco.js
Simple test data creator
https://github.com/bugthesystem/autopoco.js
Last synced: 7 months ago
JSON representation
Simple test data creator
- Host: GitHub
- URL: https://github.com/bugthesystem/autopoco.js
- Owner: bugthesystem
- License: mit
- Created: 2016-01-04T11:26:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-10-08T21:56:24.000Z (over 9 years ago)
- Last Synced: 2025-02-14T13:06:22.085Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# autopoco.js
[](https://travis-ci.org/ziyasal/autopoco.js) [](https://coveralls.io/github/ziyasal/autopoco.js?branch=master)
**Install**
```sh
npm install autopoco.js
```
**ES6**
```js
import autopoco from 'autopoco.js'
let fixture = autopoco()
fixture.define('UserModel', {
name: fixture.fakes.String,
lastName: fixture.fakes.String,
age: fixture.fakes.Number,
email: fixture.fakes.Email,
phone: fixture.fakes.Phone
})
let userList = fixture.for('UserModel').createMany() //creates 3 item by default
for (let user of userList) {
console.log(JSON.stringify(user))
}
```
**CommonJS**
```js
const autopoco = require('autopoco.js')
const fixture = autopoco.default()
fixture.define('UserModel', {
name: fixture.fakes.String,
lastName: fixture.fakes.String,
age: fixture.fakes.Number,
email: fixture.fakes.Email,
phone: fixture.fakes.Phone
})
var userList = fixture.for('UserModel').createMany() //creates 3 item by default
for (var i=0; i