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

@flametrench/ids

v0.2.0

Published

Prefixed wire-format IDs for Flametrench. UUIDv7 storage, self-describing public identifiers.

Readme

@flametrench/ids

Prefixed wire-format identifiers for Flametrench.

import { generate, encode, decode, isValid } from "@flametrench/ids";

generate("usr");
// → "usr_0190f2a81b3c7abc8123456789abcdef"

encode("org", "0190f2a8-1b3c-7abc-8123-456789abcdef");
// → "org_0190f2a81b3c7abc8123456789abcdef"

decode("usr_0190f2a81b3c7abc8123456789abcdef");
// → { type: "usr", uuid: "0190f2a8-1b3c-7abc-8123-456789abcdef" }

isValid("usr_0190f2a81b3c7abc8123456789abcdef");          // true
isValid("usr_0190f2a81b3c7abc8123456789abcdef", "org");   // false

Why prefixed IDs

Flametrench uses UUIDv7 in storage and prefixed strings on the wire. The wire format is self-describing: usr_... is a user, org_... is an organization, ses_... is a session. This is the Stripe playbook, and it pays off in every log line, support ticket, and debugger session.

The specification details live at flametrench/spec/docs/ids.md. The Laravel SDK exposes the same API shape in PHP: flametrench/ids.

Install

pnpm add @flametrench/ids
# or
npm install @flametrench/ids

Requires Node 20 or newer. ESM-only (no CommonJS build).

Registered type prefixes

The specification reserves the following prefixes:

| Prefix | Resource | Spec version | | ------ | ------------------- | ------------ | | usr | User | v0.1 | | org | Organization | v0.1 | | mem | Membership | v0.1 | | inv | Invitation | v0.1 | | ses | Session | v0.1 | | cred | Credential | v0.1 | | tup | Authorization tuple | v0.1 | | mfa | MFA factor | v0.2 | | shr | Share token | v0.2 |

Implementations must not invent prefixes outside the specification. New prefixes are added through the specification's RFC process.

Type narrowing at API boundaries

The isId type guard narrows unknown to string when a value is a valid Flametrench identifier. Useful in route handlers, webhook processors, and any boundary where incoming values need validation before use.

import { isId } from "@flametrench/ids";

export async function loadUser(raw: unknown) {
  if (!isId(raw, "usr")) {
    throw new Response("Invalid user id", { status: 400 });
  }

  // `raw` is narrowed to `string` here, and is guaranteed to be a user id.
  return fetchUserById(raw);
}

Testing

pnpm install
pnpm test

The test suite uses Vitest and covers encoding, decoding, validation, generation, round-trip properties, sortability, and cross-language parity with the PHP SDK.

License

Apache License 2.0. Copyright 2026 NDC Digital, LLC.