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

@philiprehberger/id-gen

v0.2.1

Published

Flexible ID generation with UUID, ULID, nanoid, and prefixed IDs

Readme

@philiprehberger/id-gen

CI npm version Last updated

Flexible ID generation with UUID, ULID, nanoid, and prefixed IDs. Zero dependencies

Installation

npm install @philiprehberger/id-gen

Usage

Basic ID Generation

import { uuid, ulid, nanoid, prefixedId } from '@philiprehberger/id-gen';

uuid();            // '550e8400-e29b-41d4-a716-446655440000'
ulid();            // '01ARZ3NDEKTSV4RRFFQ69G5FAV'
nanoid();          // 'V1StGXR8_Z5jdHi6B-myT' (21 chars)
nanoid(10);        // 'IRFa-VaY2b'
prefixedId('usr'); // 'usr_V1StGXR8_Z5jdHi6'

Custom Alphabet for nanoid

import { nanoid } from '@philiprehberger/id-gen';

// Numeric-only IDs
nanoid(8, '0123456789');          // '48293017'

// Hex IDs
nanoid(12, '0123456789abcdef');   // 'a3f29c01b8e4'

// Options object form
nanoid({ size: 6, alphabet: 'ABCDEF' }); // 'BCFAED'

UUID v5 (Namespace-based)

import { uuidv5, UUID_NAMESPACES } from '@philiprehberger/id-gen';

// Deterministic UUID from name + namespace
const id = await uuidv5('example.com', UUID_NAMESPACES.DNS);
// Always returns the same UUID for the same inputs

// Custom namespace UUID
const custom = await uuidv5('user-42', '12345678-1234-1234-1234-123456789abc');

ID Validation

import { isUuid, isUlid, isNanoid } from '@philiprehberger/id-gen';

isUuid('550e8400-e29b-41d4-a716-446655440000'); // true
isUuid('not-a-uuid');                            // false

isUlid('01ARZ3NDEKTSV4RRFFQ69G5FAV');           // true
isUlid('invalid');                                // false

isNanoid('V1StGXR8_Z5jdHi6B-myT');              // true (default 21 chars)
isNanoid('IRFa-VaY2b', 10);                      // true (custom length)

Batch Generation

import { generateMany } from '@philiprehberger/id-gen';

const uuids = generateMany('uuid', 5);   // 5 UUID v4 strings
const ulids = generateMany('ulid', 10);   // 10 ULID strings
const nanos = generateMany('nanoid', 3);  // 3 nanoid strings

API

| Function | Description | |----------|-------------| | uuid() | UUID v4 (RFC 4122) | | ulid() | ULID (time-sortable) | | nanoid(size?, alphabet?) | URL-safe nanoid (default 21 chars), optional custom alphabet | | nanoid({ size?, alphabet? }) | nanoid with options object | | prefixedId(prefix, size?) | {prefix}_{nanoid} (default 16 char suffix) | | uuidv5(name, namespace) | UUID v5 deterministic generation (async, SHA-1) | | UUID_NAMESPACES | Standard namespace UUIDs: DNS, URL, OID, X500 | | generateMany(type, count) | Batch generate IDs ('uuid', 'ulid', or 'nanoid') | | isUuid(value) | Validate UUID format (v1-v5) | | isUlid(value) | Validate ULID format | | isNanoid(value, length?) | Validate nanoid format (default alphabet, configurable length) |

Development

npm install
npm run build
npm test

Support

If you find this project useful:

Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT