miniroll
v0.2.2
Published
A library for rolling dice
Downloads
85
Readme
miniroll
A simple JS library for rolling dice
Installation
npm i miniroll
yarn add miniroll
Usage
const { roll, describe, describeShort } = require('miniroll')
const dice = '4d6dL'
describe(dice)
// 'roll 4 6-sided dice and drop the lowest'
describeShort(dice)
// '4d6dL'
roll(dice)
/*
{
result: 14,
rolls: [ 5, 6, 3 ],
dropped: [ 3 ],
source: '4d6dL',
rollData: {
count: 4,
sides: 6,
select: { mode: 'drop', end: 'lowest', count: 1 }
}
}
*/