Created
February 24, 2016 08:36
-
-
Save Schubidu/8f8649074a9159bfd94f to your computer and use it in GitHub Desktop.
generates participants
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var faker = require('faker'); | |
var Chance = require('chance'); | |
var fs = require('fs'); | |
var chance = new Chance(); | |
var max = 28; | |
var participants = []; | |
var i = 0; | |
for (i; i < max; i++) { | |
var spokes = chance.integer({min: 0, max: 79}); | |
var name = faker.fake('{{name.firstName}} {{name.lastName}}'); | |
participants.push({name: name, spokes: spokes}); | |
} | |
fs.writeFileSync('xxx_participants.json', JSON.stringify(participants), 'utf8'); | |
console.log(participants); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment