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

@spicelabs/coordinates

v1.1.0

Published

Canonical content identifiers (content hashes + git blob ids) and package coordinates (purl) for software artifacts — the TypeScript implementation of spice-labs-inc/coordinates.

Readme

@spicelabs/coordinates (TypeScript)

The TypeScript implementation of coordinates. Conforms to ../spec.yaml and is verified against the shared ../vectors/ in CI.

Isomorphic — one module that runs in Node and the browser on the Web Crypto API, with zero runtime dependencies (MD5, which Web Crypto lacks, is the one vendored algorithm). Covers the intrinsic identifiers (content hashes and git blob ids) and the extrinsic ones (purl).

The hashing API is async, because Web Crypto hashing is async (there is no synchronous hashing in the browser). purl is synchronous.

In the browser, the SHA functions need a secure context (https, or localhost) — that's where crypto.subtle is available; MD5 and purl work anywhere. On Node 20+ everything works out of the box.

Use

npm install @spicelabs/coordinates

Intrinsic — content hashes and git blob ids:

import { sha256, gitoidBlobSha256, intrinsic } from "@spicelabs/coordinates";

const bytes = new TextEncoder().encode("abc");
await sha256(bytes); // "ba7816bf…"
await gitoidBlobSha256(bytes); // "gitoid:blob:sha256:c1cf…"  (== `git hash-object`)
await intrinsic(bytes); // { md5, sha1, sha256, sha512, "gitoid-blob-sha1", "gitoid-blob-sha256" }

Streaming — feed the input in chunks (or from an async source such as a Node stream or a ReadableStream) and get the same six identifiers:

import { IntrinsicHasher, intrinsicStream } from "@spicelabs/coordinates";

await new IntrinsicHasher().update(chunkA).update(chunkB).finish();
await intrinsicStream(nodeReadableOrReadableStream); // any AsyncIterable<Uint8Array>

Unlike the Rust and Java versions, this buffers the chunks and hashes them at finish() — Web Crypto has no incremental digest, so the browser-compatible path can't hash truly incrementally. It's for chunked-feeding ergonomics and cross-language parity, not reduced memory use (and so, unlike Rust/Java, it needs no up-front content length).

Extrinsic — purl, parsed to a typed object and built back to canonical form:

import { purl } from "@spicelabs/coordinates";

purl.parse("pkg:npm/%40angular/[email protected]");
// { type: "npm", namespace: "@angular", name: "core", version: "17.0.0", qualifiers: {}, subpath: null }
purl.build({ type: "npm", name: "lodash", version: "4.17.21" }); // "pkg:npm/[email protected]"

Develop

pnpm install
pnpm test       # runs ../vectors against this implementation (Node)
pnpm run build
pnpm run smoke  # builds + serves; open the printed URL to run the same vectors in a real browser