Return a value equal to the roll of a die.
$ npm install --save random-dx
var dice = require('random-dx');
// API
// - dice.d4()
// - dice.d6()
// - dice.d8()
// - dice.d10()
// - dice.d12()
// - dice.d20()
// - dice.d30()
// - dice.d100()
These are just wrappers around natural() but are convenient for use by games.
dice.d20();
// => 13
dice.d6();
// => 4
- random-uuid - Return a random uuid.
- random-identity - Return a random ID.
- random-hexhash - Return a random hex hash.
- random-normal - Return a normally-distributed random variate.
- random-rpg - Return an array of dice values.
- random-file - Return a random file name with random extension.
- random-semver - Return a random version.
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.