A flexible, type-safe dice roller for tabletop RPGs, game development, and probability simulations
npm install @randsum/roller





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
``bash`
npm install @randsum/rolleror
yarn add @randsum/rolleror
bun add @randsum/roller
Roll dice directly from your terminal:
`bash`
npx randsum 2d20 # Roll two twenty-sided dice
npx randsum 4d6L # Roll 4d6, drop lowest
npx randsum 3d8+2 # Roll three d8s and add 2
Example output:
`text``
š² Roll Result:
āāāāāāāāāāāāāāā
Total: 24
Rolls: [14, 10]
Description: Roll 2d20