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

@sewdn/registry-artifacts

v1.0.1

Published

Verified artifact reads and portable archives for the Lemonaid toolkit registry

Readme

@sewdn/registry-artifacts

Read and verify toolkit registry artifacts, work with portable gzip tar file maps, and inspect npm packages in Bun or Node.js 20+. The ESM package uses ArtifactRef and the portable path rules from @sewdn/registry-contract.

npm install @sewdn/registry-artifacts
import {
  inspectNpmPackage,
  readGzipTar,
  readVerifiedArtifact,
  verifyArtifactBytes,
} from "@sewdn/registry-artifacts";

const archive = await readVerifiedArtifact(releaseRef, new URL("https://owner.example/releases"));
const release = readGzipTar(archive);
const packageBytes = release.get(packageRef.location);
if (!packageBytes) throw new Error("Missing " + packageRef.location);
const pkg = inspectNpmPackage(await verifyArtifactBytes(packageRef, packageBytes));
console.log(pkg.name, pkg.version);

Artifact references

resolveArtifactLocation(base, location) returns an absolute local path or a URL. The base denotes a directory, including an HTTP base without a trailing slash. Absolute artifact locations must be HTTP(S) URLs with a portable path. Credentials, query strings, fragments, percent-encoded path segments, and absolute filesystem locations are rejected.

readVerifiedArtifact(ref, base, { maxBytes? }) returns bytes only after SHA-256 verification. Local reads use a canonical base directory and accept real directory components and regular files beneath it. Use a stable directory under the caller's control during reads. HTTP reads require a complete successful response with identity content encoding and a 30-second deadline. Supply the final artifact URL because redirects are rejected. Reads are capped at 64 MiB, with an optional lower per-read limit.

readArtifactBytes(location, base, { maxBytes? }) uses the same bounded reader for mutable metadata at an explicitly trusted location. Parse the document and verify any artifact references it advertises. HTTP transport failures and missing or temporarily unavailable responses produce ArtifactUnavailableError. Rejected redirects, invalid responses and digest failures remain validation errors.

verifyArtifactBytes(ref, bytes) verifies the digest of an already buffered artifact, such as a member of a verified release archive. It returns the supplied bytes after the same 64 MiB bound and digest check.

File maps and npm manifests

readGzipTar(bytes) accepts gzip-compressed POSIX ustar archives, including Bun's ustar prefix fields. It returns a Map<string, Uint8Array> of regular file paths. Directory headers are validated and left out of the map. Links, special entries, PAX and GNU extensions, duplicated or case-colliding paths, file/directory conflicts, and malformed headers or padding are rejected. Bounds are 64 MiB compressed, 128 MiB decompressed, 32 MiB per file, and 20,000 file and directory entries.

writeGzipTar(files) accepts a readonly file map and writes paths in ascending order with zero timestamps and numeric ownership. It uses regular-file mode 0644 and implicit directories. Use a separately packed npm distribution archive for packages that require executable modes. Paths must fit the 100-byte name and 155-byte prefix fields of ustar.

inspectNpmPackage(bytes) checks the package/ archive root, parses package/package.json, and returns the exact package name and version, explicit public export subpaths, ordinary and optional dependencies, peer dependencies, optional peer names, the full manifest, and a file map relative to package/. Legacy manifests without exports return an empty list of explicit subpaths. Export resolution and entry-point checks belong to consumers. Run digest verification before parsing untrusted archive bytes. File maps let downstream consumers apply their own confinement and write preconditions.

From the Kit workspace, run bun run registry:prepare at the root, then bun run typecheck and bun run test from this package. The HTTP tests use a loopback listener.