https://github.com/nothingrandom/roll
🎲 A dice roller / random number generator
https://github.com/nothingrandom/roll
Last synced: 4 months ago
JSON representation
🎲 A dice roller / random number generator
- Host: GitHub
- URL: https://github.com/nothingrandom/roll
- Owner: nothingrandom
- License: mit
- Created: 2020-01-16T20:29:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-06T08:36:53.000Z (10 months ago)
- Last Synced: 2025-03-19T03:56:39.401Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.17 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# roll

> A dice roller / random number generator## Install
``` bash
$ yarn global add @nothingrandom/roll
$ npm install --global @nothingrandom/roll
```## Usage (CLI)
``` bash
$ roll --helpUsage
$ rollExample
$ roll d20 # rolls one die with 20 sides
1 - 20$ roll 2d20 # rolls two dice with 20 sides each
2 - 40$ roll 2d20+d3 # rolls two dice with 20 sides and one die with 3 sides
3 - 43
```## Usage (require in JS)
``` js
const Roll = require('@nothingrandom/roll');
const roll = new Roll();roll.roll('2d20').result;
// roll.roll(INPUT) will return
// {
// rolled: number,
// average: number[],
// result: number,
// }
```## License
MIT © [Benjamin Grant](https://nothingrandom.com)