Package Exports
- dice-rolling
- dice-rolling/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dice-rolling) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
dice-rollinging
🎲 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!
Installation
npm install -g dice-rollingUsage
# Basic roll
dice 3d6
# Roll with modifier
dice 2d20+5
dice 4d8-2
# Show statistics
dice 1d20 stats
# Get help
dice helpCommon Notation Examples
1d4- Dagger damage1d6- Mace damage1d8- Longsword damage1d10- Greataxe damage1d20- Standard attack roll3d6- Stat roll (D&D ability score)2d6+2- Fireball with modifier
API
Use it in your JavaScript/TypeScript projects:
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" }Features
✨ Simple and intuitive dice notation 📊 Statistical analysis of rolls 🎮 Perfect for game development 🚀 Zero dependencies ⚡ Fast and lightweight
License
MIT