Fake sports generator
Currently this tool generates the following fake data:
- a specified number of fake players
- a specified number of fake teams
- a number of simulated scoring events for a fake baseball game
- a fake lineup of random players for one team.
Instructions
-
import the DataGenerator class.
-
create an instance of DataGenerator and call one of the four functions: getPlayers(num), getTeams(num), getScoringEvents(), getLineup(new Team())
-
it will return an array of objects.
-
calling the writeData method of the DataGenerator class with the filename and the array of objects will write to file a JSON file of the fake objects.
const generator = new DataGenerator();
console.log(generator.getPlayers(3))
generator.writeData("players.json", generator.getPlayers(3))