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

orzo

v0.4.1

Published

A library for random events like dice rolls and random strings.

Readme

orzo

Build Status Coverage Status

A library for random events like dice rolls and random strings.

Table of Contents

Requirements

orzo requires the following to run:

Usage

orzo is easily installed with npm:

npm install orzo

Then you can load the library into your project with a require:

var orzo = require('orzo');

The orzo object has the following methods:

orzo.dice({ min: 1, max: 6 })

Returns a random number between the min and max values.

  • min is the lowest possible random number (inclusive). (Number, Optional, Default: 1)
  • max is the highest possible random number (inclusive). (Number, Optional, Default: 6)
  • return is a random number (Number)
// examples
orzo.dice() // 4
orzo.dice({ max: 20 }) // 13
orzo.dice({ min: -50, max: 50 }); // -12

orzo.chars({chars: '', len: 10 })

Returns a random set of characters.

  • chars is the character set for the random string. (String, Optional, Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHHIJKLMNOPQRSTUVWXUZ0123456789')
  • len is the length for the random string. (Number, Optional, Default: 10)
  • return is a string with random characters. (String)
// examples
orzo.chars() // FBnQPprZw3
orzo.chars({ len: 25, chars: orzo.HEX_CHARACTERS }) // ff0b28ef67d91e04c1b707169

orzo.uuid()

Returns a valid UUIDv4.

  • returns a UUIDv4. (String)
// example
orzo.uuid() // 5287a662-0623-4ff4-8228-3a3b371926a3

orzo.encode({ input: '', chars: '' })

Returns a string encoded in a specified base.

  • input is the input to convert to the different base. (String)
  • chars is the character set for the new base. (String, Optional, Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHHIJKLMNOPQRSTUVWXUZ0123456789')
  • return is a string in the custom base. (String)
// examples

// encode 1999 to base16
orzo.encode({input: 1999, chars: orzo.HEX_CHARACTERS}) // 7cf

// encode 1999 to base62
orzo.encode({input: 1999}) // wf

orzo.decode({ input: '', chars: '' })

Returns a string back to base10.

  • input is the input to convert to base10. (String)
  • chars the characters used previously to conver the base. (String, Optional, Default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHHIJKLMNOPQRSTUVWXUZ0123456789')
  • return is a string in base10. (String)
// examples

// decode 7cf from base16 to base10
orzo.decode({input: '7cf', chars: orzo.HEX_CHARACTERS}) // 1999

// decode wf from base62 to base10
orzo.decode({input: 'wf'}) // 1999

Constants

Various character sets to use.

  • orzo.NUMBERS = 0123456789
  • orzo.LOWERCASE_CHARACTERS = abcdefghijklmnopqrstuvwxyz
  • orzo.UPPERCASE_CHARACTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • orzo.SPECIAL_CHARACTERS = !@#$%^&*()
  • orzo.HEX_CHACTERS = 0123456789abcdef

Contributing

To contribute to orzo, clone this repo locally and commit your code on a new branch. Unit tests are required for all features.

License

orzo is licensed under the MIT license.

Copyright © 2015, Ryen Nelsen