JSPM

  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q87645F
  • License MIT

A flexible, type-safe dice roller for tabletop RPGs, game development, and probability simulations

Package Exports

  • @randsum/roller
  • @randsum/roller/package.json

Readme

Randsum Logo. A Dotted D6 rolled a 6 with the dots arranged to look like an R.

@randsum/roller

Advanced Dice Rolling for JavaScript & TypeScript

npm version bundle size Types License Downloads

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/roller

CLI 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 2

Example output:

ðŸŽē Roll Result:
───────────────
Total: 24
Rolls: [14, 10]
Description: Roll 2d20