@randsum/roller
v1.0.0
Published
A flexible, type-safe dice roller for tabletop RPGs, game development, and probability simulations
Maintainers
Readme
A flexible, type-safe dice rolling implementation for tabletop RPGs, game development, and probability simulations that supports:
- 🎲 Standard dice notation (
4d6,2d20H, etc.) - 🎯 Complex modifiers (drop lowest, reroll, exploding dice)
- 🔒 Full TypeScript support with intelligent type inference
- 🎮 Perfect for games, RPGs, and simulations
- 🪶 Tree-shakeable implementation for minimal bundle size
- 📦 Optimized for performance and reliability
- 🧩 Extensible architecture for custom game systems
- 🌐 Works in Node.js, browsers, and React Native
Installation
npm install @randsum/roller
# or
yarn add @randsum/roller
# or
bun add @randsum/rollerCLI Usage
Roll dice directly from your terminal:
npx randsum 2d20 # Roll two twenty-sided dice
npx randsum 4d6L # Roll 4d6, drop lowest
npx randsum 3d8+2 # Roll three d8s and add 2Example output:
🎲 Roll Result:
───────────────
Total: 24
Rolls: [14, 10]
Description: Roll 2d20