Create random JSON objects using json-spawn and Chance.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
// }
// }
$ 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
}
}
$ npm install json-chance
$ npm test
$ npm run coverage