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

@billdaddy/idkit

v0.1.1

Published

Tiny, secure id toolkit — URL-safe random ids (nanoid-style) and lexicographically sortable ULIDs with a monotonic factory. Zero dependencies.

Downloads

215

Readme

idkit

All Contributors

Tiny, secure id toolkit — URL-safe random ids (nanoid-style) and lexicographically sortable ULIDs with a monotonic factory. Zero dependencies.

CI npm version bundle size types license

Two kinds of id cover almost everything: a short, random, URL-safe one for public handles and tokens, and a time-sortable one for database keys that you want to order by creation without a separate timestamp column. idkit gives you both — backed by the Web Crypto RNG, with no modulo bias — in one zero-dependency package that runs in Node and the browser.

import { nanoid, ulid } from "@billdaddy/idkit";

nanoid();  // "V1StGXR8_Z5jdHi6B-myT"          → public ids, tokens
ulid();    // "01ARZ3NDEKTSV4RRFFQ69G5FAV"     → sortable primary keys

Why idkit?

  • Secure by default. Every byte comes from crypto.getRandomValues; alphabets use masked rejection sampling, so each character is uniformly distributed.
  • Random and sortable. nanoid for compact random ids; ulid for ids that sort by time as plain strings.
  • Monotonic ULIDs. A factory that guarantees strictly increasing ids even within the same millisecond.
  • Inspectable. decodeTime reads the timestamp back out of a ULID; isUlid validates one.
  • Custom alphabets. Build a generator over any alphabet (numeric OTPs, hex tokens, your own symbol set).
  • Zero dependencies, ESM + CJS + types, Node 18+ and modern browsers.

Install

npm install @billdaddy/idkit
# or: pnpm add @billdaddy/idkit  /  yarn add @billdaddy/idkit  /  bun add @billdaddy/idkit

Random ids

import { nanoid, customAlphabet } from "@billdaddy/idkit";

nanoid();    // 21 chars, ~121 bits of entropy (UUID-class collision odds)
nanoid(10);  // shorter when you don't need as much

// Custom alphabets — uniform, no bias even for non-power-of-two lengths:
const otp = customAlphabet("0123456789", 6);
otp();       // "473829"

const token = customAlphabet("0123456789abcdef");
token(32);   // 32-char hex

Sortable ids (ULID)

A ULID is a 26-character Crockford Base32 string: a 48-bit millisecond timestamp followed by 80 bits of randomness. It sorts by creation time as a string and is case-insensitive.

import { ulid, monotonicFactory, decodeTime, isUlid } from "@billdaddy/idkit";

ulid();              // "01ARZ3NDEKTSV4RRFFQ69G5FAV"
ulid(1469918176385); // pin the timestamp

decodeTime("01ARZ3NDEKTSV4RRFFQ69G5FAV"); // 1469918176385
isUlid(someString);                        // boolean

// Strictly increasing ids, even in a tight loop within one millisecond:
const nextId = monotonicFactory();
nextId();
nextId(); // sorts strictly after the previous

When to use which

| Need | Use | | --- | --- | | Public-facing handle, share token, short id | nanoid() | | Database primary key you can sort by time | ulid() | | Guaranteed ordering across rapid inserts | monotonicFactory() | | Fixed-format code (OTP, hex, custom) | customAlphabet() |

Pairs well with

| Need | Use | | --- | --- | | Validate ids in typed config / env | envguard | | Redact ids/secrets from logs | scrubtext |

Contributors ✨

This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

License

MIT © Tung Tran