Package Exports
- @randsum/roller
- @randsum/roller/guards
- @randsum/roller/modifiers
- @randsum/roller/package.json
- @randsum/roller/utils
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