RANDSUM is one dice engine with several ways in. The npm packages hold the code, an open spec defines the notation, and the API, Roller app, Discord bot and agent plugin put the same engine in front of people who are not writing TypeScript. Every package ships ESM with full type declarations and is published to npm under @randsum.
The zero-dependency dice engine with built-in notation parsing and validation. Accepts numbers, notation strings, or options objects and returns typed results with every modifier step. Also exports isDiceNotation, validateNotation, notationToOptions, optionsToNotation, tokenize and more, so most projects only need this package.
Ready-made rules for seven tabletop games, each a subpath export. Every game is generated from an open .randsum.json spec and wraps @randsum/roller with that system’s dice pools, modifiers and outcomes.
The roller as Web Components: one element in three sizes, Max, Compact and Mini, plus every part it is built from, with React, Vue and Svelte bindings and React Native components. Each component is its own import, so a page ships only what it uses.
Random Numbers as a service: a free, keyless REST API at api.randsum.dev. It can roll notation, roll for any supported game, or draw random integers, from any language.
Zero core dependencies: @randsum/roller has no runtime dependencies and includes the full notation parser and validator
Throws on invalid input: roll() throws typed errors on bad input (ValidationError, ModifierError, or NotationParseError); validate user-provided strings with isDiceNotation() or validateNotation() before rolling
Games are code-generated: every game is a .randsum.json spec compiled into TypeScript by the games package’s codegen
Strict TypeScript: isolatedDeclarations, exactOptionalPropertyTypes, noUncheckedIndexedAccess, no any
Bundle size enforced: every roller and games entry point has a size budget checked in CI by size-limit; the budgets live in each package’s size-limit config (packages/roller/package.json, packages/games/.size-limit.ts)