Skip to content

Throw Dice,
Not Exceptions.

A Zero Dependency, Typescript-First, Bun-Native Dice Notation and Rolling Engine.

index.ts
import { roll } from '@randsum/roller'
const { total, rolls } = roll('4d6L')
console.log(total)
// 15
console.log(rolls[0].initialRolls)
// [1, 5, 4, 6]
console.log(rolls[0].rolls)
// [4, 5, 6]
console.log(rolls[0].description)
// ["Roll 4 6-sided dice", "Drop lowest"]

Every modifier,
parsed and validated .

@randsum/roller is a zero-dependency dice engine with a complete notation spec — fully specified, documented, and implemented. Every common rolling pattern covered so you never have to invent your own.


Define Rules ,
get Rolls .

Describe your game’s mechanics in a .randsum.json spec and @randsum/games generates a bespoke, fully-typed roller for that system. Adding a new game is just writing a config file.


You can Roll
your own way.

In your terminal, in your Discord, or in your dev workspace — wherever you need numbers, RANDSUM is there. A CLI for quick rolls, a Discord bot for game night, a Claude plugin for AI-assisted rolling, and an npm package for everything else.


Features

Zero Dependencies

TypeScript First

Bun Native

RDN Spec

Game Support

ESM Only

Under 20KB

26 Modifiers