JSPM

dice-rolling

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q48555F
  • License MIT

A fun CLI tool to roll dice and make random decisions from the terminal

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-rolling

Usage

# Basic roll
dice 3d6

# Roll with modifier
dice 2d20+5
dice 4d8-2

# Show statistics
dice 1d20 stats

# Get help
dice help

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 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