Package Exports
- xdice
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xdice) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
xDice - Simple Dice Randomizer for Gamers
Want a quick way to add simulated dice rolls into your app? Have a RPG mind? Do you think about dice in game terms, like roll 1D6, and roll 1D20?
Then this is the module for you;)
Install
npm install xdiceUsage
And include into your project
var roll = require('xdice');Now to roll dem-bones
roll('1d6'); //5
roll('1d20'); //16How about a bunch of dice
roll('4D6'); // 12Bunch of different dice?
roll('4d6') + roll('1d4'); // 14But I want PIPS!!! Ok, simple, same as above
roll('1d6') + 2; // 7Behind the scenes xDice gets a collection of results and returns the sum of those results, but if you want the result array you can get that too
roll('4d6', true); // [4,5,2,1]Run Tests
npm testLicense
MIT