Skip to content

Installation

The core @randsum/roller package is all you need for general-purpose dice rolling. It has zero runtime dependencies.

Terminal window
bun add @randsum/roller

If you are building for a specific tabletop RPG system, install the corresponding game package. Each game package automatically installs @randsum/roller as a dependency.

Terminal window
# D&D 5th Edition
bun add @randsum/fifth
# Blades in the Dark
bun add @randsum/blades
# Powered by the Apocalypse
bun add @randsum/pbta
# Daggerheart
bun add @randsum/daggerheart
# Root RPG
bun add @randsum/root-rpg
# Salvage Union
bun add @randsum/salvageunion
  • Node.js 18+ or Bun 1.0+
  • TypeScript 5.0+ (recommended but not required)

All packages ship as both ESM and CJS with full type declarations.

import { roll } from '@randsum/roller'
const result = roll('2d6')
console.log(result.total) // Sum of 2d6

If this runs without errors, you are ready to go. Head to the Quick Start guide to learn the basics.