Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@half-elf/rogue

sindrekjr852MIT1.0.1TypeScript support: included

Utility library for all underhanded d20 needs.

d20, rpg, util

readme

Rogue

Utility library for all underhanded d20 needs.

Usage

Dice library

const { roll } = require('@half-elf/rogue');

const singleRoll = roll('d20');
const weirdCompositeRoll = roll('(d4)d6 + 4');
const rollWithOptions = roll('20d4', { max: true, min: true, avg: true });

const { total, max, min, avg } = rollWithOptions;