RANDSUM
Throw Dice,
Not Exceptions.
A Zero Dependency, Typescript-First, Bun-Native Dice Notation and Rolling Engine.
import { roll } from '@randsum/roller'
const { total, rolls } = roll('4d6L')
console.log(total)// 15console.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.
Blades in the Dark
Roll action dice. Resolve critical, success, partial, or failure for Blades in the Dark.
View docs →Daggerheart
Roll hope and fear dice, see which dominates, detect critical hope for Daggerheart.
View docs →Fate Core
Roll 4dF + skill against the Fate ladder. Resolve Terrible up to Legendary for Fate Core.
View docs →D&D 5th Edition
d20 roll resolution for D&D 5e.
View docs →Root RPG
Roll 2d6+bonus. Strong hit, weak hit, or miss for Root: The RPG.
View docs →Salvage Union
d20 table lookups for Salvage Union.
View docs →Powered by the Apocalypse
Roll 2d6+stat. Miss, weak hit, or strong hit for any Powered by the Apocalypse game.
View docs →Claude Plugin
Claude Code plugin with skills for dice rolling, probability analysis, and game spec authoring.
View docs →Discord Bot
Discord bot with slash commands for all RANDSUM packages.
View docs →CLI
Command-line interface for rolling dice and exploring notation from your terminal.
View docs →MCP Server
Model Context Protocol server exposing roll, validate, and roll_game tools to AI agents.
View docs →