A fun CLI tool to roll dice and make random decisions from the terminal
š² A fun CLI tool to roll dice and make random decisions from your terminal.
Perfect for game development, D&D-inspired projects, or just making decisions the fun way!
``bash`
npm install -g dice-rolling
`bashBasic roll
dice 3d6
Common Notation Examples
-
1d4 - Dagger damage
- 1d6 - Mace damage
- 1d8 - Longsword damage
- 1d10 - Greataxe damage
- 1d20 - Standard attack roll
- 3d6 - Stat roll (D&D ability score)
- 2d6+2 - Fireball with modifierAPI
Use it in your JavaScript/TypeScript projects:
`typescript
import { rollAndSum, getRollStats } from "dice-rolling";// Roll dice
const result = rollAndSum("3d6");
console.log(result); // { rolls: [4, 2, 5], total: 11, modifier: 0 }
// Get statistics
const stats = getRollStats("1d20");
console.log(stats); // { min: 1, max: 20, average: 10.5, notation: "1d20" }
``⨠Simple and intuitive dice notation
š Statistical analysis of rolls
š® Perfect for game development
š Zero dependencies
ā” Fast and lightweight
MIT