random.weighted
npm install random.weighted
//define possible events including weighted probability//(can be any integer score, like total counted words etc..) var p1 = ;
with that setup trees is expected to occur ~twice as often as bikes, and cars ~twice as often as trees
//gets the next random eventvar event = p1; //gets new array of random weighted eventsvar events = p1; //all emitted eventsconsole; //event statsconsole; //print formatted statsconsole;