Skip to content

RANDSUM/randsum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@randsum

A powerful collection of utilities for rolling dice in Javascript

Introduction

@randsum is a powerful collection of dice-rolling utilities. You can roll common dice with @randsum/dice:

import { D20 } from `@randsum/dice`

// Roll a single D20
D20.roll()

// Roll 4 D20
D20.rollMany(4)

Or compose powerful rolls with multiple dice and modifiers using @randsum/tower:

import { roll } from `@randsum/tower`

// Roll 4 D6 and 2 D20
roll({quantity: 4, sides: 6}, D20)

// Roll 4 D6, drop the lowest, and roll three d8
roll({ quantity: 4, sides: 6, modifiers: { drop: { lowest: true } } }, {quantity: 3, sides: 8})

Validate and manipulate dice notation with @randsum/notation:

import { validate, DiceNotation } from `@randsum/notation`

const { valid } = validate('4d6L')

const notation: DiceNotation = `4D6!` // valid
const badNotation: DiceNotation = `4X2` // invalid

...and more!


Made with Bun Written in TypeScript

About

A Monorepo for the @RANDSUM Dice Rolling utilites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published