Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nothingrandom/roll
🎲 A dice roller / random number generator
https://github.com/nothingrandom/roll
Last synced: 17 days 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-06T08:36:53.000Z (2 months ago)
- Last Synced: 2024-10-07T23:20:22.749Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 1.17 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# roll
![Travis (.com)](https://img.shields.io/travis/com/nothingrandom/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)