npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yadicer

v0.2.0

Published

Yet Another Dice Roller

Readme

Yet Another DICE Roller

Build Status

Work in progress, use with caution. I wouldn't use this in production.

A simple dice roller NPM module, just for the sake of practicing creating and publishing NPM modules.

Made with TypeScript, and provides typescript support out of the box.

FAQ

  1. Q: What's with the name? Why not yadr? A: It's already taken. Seriously, most dice-rolling names have been taken
  2. Q: How do I use it in Node? A: See below
  3. Q: Why does it return a promise, as opposed to a simple result? A: At the moment the library uses JavaScript's built in Math.random() function to roll the dice, which is by no means truly random. In the future I want to add Random.org's API, which will take some time. It would also be cool to add ability to add a seed, like in Java.

How to use in Node

  • Using CommonJS (require) with .then
const roll = require("yadicer");

roll("2d20").then((result) => {
  console.log(`We rolled a total of ${result.total}`);
});
  • Same, but with async/await
const roll = require("yadicer");

// In an async function
const result = await roll("2d20");
console.log(`We rolled a total of ${result.total}`);
  • Using ES6 imports (import)
import roll from "yadicer";

// In an async function
const result = await roll("2d20");
console.log(`We rolled a total of ${result.total}`);
  • Using Typescript
import * as roll from "yadicer";

// In an async function
const result = await roll("2d20");
console.log(`We rolled a total of ${result.total}`);

Notes

It doesn't currently work in the browser out of the box, but should do with a bundler like Webpack or Parcel

Enabling "true" random rolls

By default, yadicer uses Javascript's native Math.random() function to determine the rolls. Like any computer-generated random value, it's not really random but pseudo-random. With yadicer 0.2 we are introducing much more random rolls by using Random.org API. Random.org uses environmental noise for generating the values, and as such is a lot more random.

Using Random.org-generated rolls

// In an async function
const trueRandomRoll = await roll("5d20", { useRandomOrg: true });

Please note that since this approach uses an external HTTP request it's going to be thousands of times slower, so plan accordingly.