Skip to content

Instantly share code, notes, and snippets.

@Schubidu
Created February 24, 2016 08:36
Show Gist options
  • Save Schubidu/8f8649074a9159bfd94f to your computer and use it in GitHub Desktop.
Save Schubidu/8f8649074a9159bfd94f to your computer and use it in GitHub Desktop.
generates participants
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