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

@code-net/identity

v1.2.0

Published

Lightweight UUID helpers on top of `uuid`, plus a type-safe `Uuid` value object for application identifiers.

Downloads

178

Readme

@code-net/identity

Lightweight UUID helpers on top of uuid, plus a type-safe Uuid value object for application identifiers.

Why use it

  • Thin, tree-shakeable wrapper over uuid
  • Friendly Uuid class with helpers and equality checks
  • Optional branded subclasses for type-safe IDs (e.g. UserId, OrderId)
  • Ready for v4, v5, and v7 UUIDs

Install

pnpm add @code-net/identity
# or npm/yarn

Quick start

Generate UUIDs directly:

import { uuid } from '@code-net/identity';

const idv4 = uuid.v4();
const idv7 = uuid.v7();

const NAMESPACE = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
const idv5 = uuid.v5('some string', NAMESPACE);

Work with the Uuid class:

import { Uuid } from '@code-net/identity';

const id1 = new Uuid();            // defaults to v7
const id2 = new Uuid(id1.uuid);    // build from a string

id1.toV5('some string');           // derive a v5 using this instance as namespace
id1.equals(id2);                   // strict comparison

id1.toString(); // "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
id1.toJSON();   // serializes as plain string
id1.uuid;       // explicit string access

Create branded, type-safe IDs:

import { Uuid } from '@code-net/identity';

class UserId extends Uuid<'User'> {}
class ProductId extends Uuid<'Product'> {}

const userId = new UserId();
const productId = new ProductId();

// @ts-expect-error: different brands, prevents cross-assignments
const bad: UserId = productId;

API notes

  • uuid: Direct re-export of uuid functions (v4, v5, v7).
  • Uuid:
    • constructor(value?: string): new random v7 by default, or wrap an existing UUID string.
    • toV5(value: string): produce a v5 UUID using this instance as namespace.
    • equals(other: Uuid): strict equality by value.
    • uuid, toString(), toJSON(), valueOf(): string accessors.