# rpgdice

> Simple eventful dice for rpg or any dicegame

Latest version **0.2.0** (published 2013-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install rpgdice
pnpm add rpgdice
yarn add rpgdice
bun add rpgdice
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2013-06-16 |
| First published | 2012-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Olli K |
| Maintainers | gildean |
| Keywords | rpg, dice, game |

## Links

- npm: https://www.npmjs.com/package/rpgdice
- Repository: https://github.com/gildean/rpgdice
- Issues: https://github.com/gildean/rpgdice/issues
- npm.io page: https://npm.io/package/rpgdice

## Recent versions

- 0.2.0 (latest) — 2013-06-16
- 0.1.0 — 2012-12-16
- 0.0.2 — 2012-12-13
- 0.0.1 — 2012-12-12

## README

rpgdice
=======
by: ok 2012


Simple eventful dice for rpg or any dicegame.

Designed to support multiple games and players using the same dice, for example in multiple socket.io rooms.

Usage
-----
Install the module:
`npm install rpgdice`

Require the module:
`var dice = require('rpgdice');`

Roll the dice:
`dice.roll('1d6+4', 'player1', 'game1')`
  * the dice must be in the form of *rolls* __d__ *sides*
  * the modifier (+4 etc.), the playername and the gamename can be omitted*

events
------
dice.on(' *event* ', function ( *args* ) {});

__'rolling', dice, roller, game__

*when a player rolls*
  * *dice* _string_
  * *roller* _string_
  * *game* _string_

__'roll', roll, roller, game__

*when a single dice rolls*
  * *roll* _string_
  * *roller* _string_
  * *game* _string_

__'result', dice, rolls, result, roller, game__

*when all the dice have been rolled*
  * *dice* _string_
  * *rolls* _array_
  * *result* _number_
  * *roller* _string_
  * *game* _string_

__'misroll', error, roller, game__

*if the dice was malformed or other errors occur*
  * *error* _error_
  * *roller* _string_
  * *game* _string_

License
-------
MIT: [http://ok.mit-license.org/](http://ok.mit-license.org/)

---
_Source: https://npm.io/package/rpgdice · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
