Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/signpostmarv/diceroll

diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.
https://github.com/signpostmarv/diceroll

Last synced: 5 days ago
JSON representation

diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.

Awesome Lists containing this project

README

        

# About diceRoll

diceRoll is a simple library for parsing strings commonly used in pen & paper RPGs then generating dice rolls.

## Examples
```typescript
const instance = new DiceRoll('2d10+4');
const assert = 2 === instace.count;
const assert = 10 === instace.faces;
const assert_action = '+' === instace.modifier.action;
const assert_modifier = 4n === instace.modifier.modifier;

(new DiceRoll('2d10+4')).roll();

(new DiceRoll('2d10+4')).multiRoll(10);
```