D&D 5th Edition
@randsum/fifth
Dungeons & Dragons 5th Edition mechanics including ability checks, saving throws, and combat rolls.
Installation
npm install @randsum/fifth
# or
bun add @randsum/fifth Examples
Basic Roll
import { roll } from "@randsum/fifth"
import type { RollArgument } from "@randsum/fifth"
// Basic roll with modifier
roll({ modifier: 5 }) Roll with Advantage
import { roll } from "@randsum/fifth"
// Roll with advantage
roll({
modifier: 5,
rollingWith: "Advantage"
}) Roll with Disadvantage
import { roll } from "@randsum/fifth"
// Roll with disadvantage
roll({
modifier: -2,
rollingWith: "Disadvantage"
}) Installation
npm install @randsum/fifth
# or
bun add @randsum/fifth About D&D 5th Edition
The @randsum/fifth package provides comprehensive mechanics for
Dungeons & Dragons 5th Edition
, the world's most popular tabletop RPG.
This package implements ability checks, saving throws, attack rolls, damage rolls, and other core D&D 5e mechanics, including support for advantage, disadvantage, and various modifiers.
For more information, see the package source code .