https://github.com/lufzle/json-chance
Create random JSON objects using json-spawn and Chance.js
https://github.com/lufzle/json-chance
Last synced: 19 days ago
JSON representation
Create random JSON objects using json-spawn and Chance.js
- Host: GitHub
- URL: https://github.com/lufzle/json-chance
- Owner: lufzle
- License: mit
- Created: 2015-07-16T18:45:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-20T05:54:25.000Z (almost 10 years ago)
- Last Synced: 2025-03-22T13:01:42.835Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 129 KB
- Stars: 21
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-chance
[](http://badge.fury.io/js/json-chance) [![NPM downloads][npm-downloads-image]][npm-downloads-url] [](http://travis-ci.org/luisfarzati/json-chance) [](https://gemnasium.com/luisfarzati/json-chance) [](https://www.gratipay.com/luisfarzati)
Create random JSON objects using [json-spawn](https://github.com/luisfarzati/json-spawn) and [Chance.js](http://chancejs.com/).
### Node
```js
var jsonChance = require('json-chance')jsonChance('guid,name,profile(url,twitter,fbid)')
// returns
// {
// "guid": "55585f1d-aedf-50ef-9436-3cbeb3e76afc",
// "name": "William McCoy",
// "profile": {
// "url": "http://bim.gov/du",
// "twitter": "@nijgu",
// "fbid": 1000053597266623
// }
// }```
### CLI
```bash
$ jsonchance 'guid,name,profile(url,twitter,fbid)'{
"guid": "55585f1d-aedf-50ef-9436-3cbeb3e76afc",
"name": "William McCoy",
"profile": {
"url": "http://bim.gov/du",
"twitter": "@nijgu",
"fbid": 1000053597266623
}
}
```## Installation
```bash
$ npm install json-chance
```## Tests
```bash
$ npm test
$ npm run coverage
```## License
[MIT](LICENSE)
[npm-downloads-image]: https://img.shields.io/npm/dm/json-chance.svg
[npm-downloads-url]: https://npmjs.org/package/json-chance