rollindeprecated

Roll dice from the command line using D&D-style syntax

Usage no npm install needed!

<script type="module">
  import rollin from 'https://cdn.skypack.dev/rollin';
</script>

README

rollin (urban assault vehicle, natch)

A little library for doing dice rolls.

Install

npm install rollin

Usage:

From inside node:

const roll = require('rollin');

console.log(roll('3d6'));
console.log(roll('d8'));
console.log(roll('12d4+2'));
console.log(roll('d100+12'))

From the cli:

josh@pidgey:~$ roll 3d6+2
9

Commands are of the form {number_of_dice}d{sides_of_die}[+/-{some_modifier}]. Spaces are stripped, otherwise the DSL is pretty limited.

Tests:

npm test