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

@beamhop/registry

v0.1.2

Published

Pure-TypeScript OCI Distribution v2 client — pull and push images without a Docker daemon.

Downloads

513

Readme

@beamhop/registry

A pure-TypeScript OCI Distribution v2 client. Pull and push images from Docker Hub, GHCR, ECR, GCR, or any conformant registry — with no Docker daemon involved.

bun add @beamhop/registry

Pulling

import { BlobStore, parseReference } from "@beamhop/oci"
import { hostPlatform, pullImage } from "@beamhop/registry"

const store = new BlobStore("./cache/blobs")

const image = await pullImage(store, parseReference("alpine:3.20"), {
  platform: hostPlatform(),
  onProgress: ({ index, total, cached }) =>
    console.log(`layer ${index + 1}/${total} ${cached ? "cached" : "downloaded"}`),
})

console.log(image.config.config?.Cmd)   // [ "/bin/sh" ]
console.log(image.layers.length)

Multi-platform references are resolved through their index, and BuildKit's SBOM and provenance manifests are skipped rather than mistaken for images.

Every downloaded blob is verified against the digest that referenced it before it is committed, and layers already in the store are not downloaded again — which is what makes a second build on the same base nearly free.

Diff IDs are recomputed from the bytes rather than trusted from the config, so a disagreement surfaces at pull time instead of producing an image that fails to unpack.

Pushing

import { pushImage } from "@beamhop/registry"

const digest = await pushImage(image, parseReference("ghcr.io/me/app:v1"), {
  auth: { kind: "basic", username: "me", password: process.env.GITHUB_TOKEN ?? "" },
  onProgress: (event) => console.log(event.what, event.skipped ? "(already present)" : "uploaded"),
})

Blobs go up before the manifest that references them, as the spec requires, and blobs the registry already holds are skipped after a cheap HEAD — so re-pushing an image whose base layers are already there transfers only what changed.

Authentication

Credentials are resolved in this order: explicit auth, then ~/.docker/config.json. Anonymous pulls work without either — Docker Hub still issues a token, and the client handles that challenge automatically.

// Explicit
{ auth: { kind: "basic", username: "deploy", password: process.env.TOKEN ?? "" } }
{ auth: { kind: "bearer", token: process.env.TOKEN ?? "" } }

// Skip the Docker config entirely
{ useDockerCredentials: false }

Tokens are cached per scope, so pulling twenty layers from one repository costs one token exchange.

Local and internal registries

// Plain HTTP, e.g. a local `registry:2` on port 5050
await pullImage(store, parseReference("localhost:5050/app:v1"), { insecure: true })

// An internal CA
await pullImage(store, parseReference("registry.corp.io/team/app:v1"), {
  caCerts: "/etc/ssl/corporate-ca.pem",
})

Errors

RegistryAuthError says whether credentials were even available. PlatformNotFoundError lists the platforms that are published. ForeignLayerError refuses non-distributable layers rather than producing an image whose layers cannot be fetched. RegistryRequestError carries the status and response body.

import { PlatformNotFoundError } from "@beamhop/registry"

try {
  await pullImage(store, parseReference("some/image"), {
    platform: { os: "linux", architecture: "riscv64" },
  })
} catch (error) {
  if (error instanceof PlatformNotFoundError) console.log(error.available)
  // [ "linux/amd64", "linux/arm64" ]
}

Lower-level access

RegistryClient exposes the raw API when you need it — getManifest, blobStream, blobExists, putBlob, putManifest — with auth handled for you.

import { RegistryClient } from "@beamhop/registry"

const client = new RegistryClient("ghcr.io")
const { bytes, mediaType, digest } = await client.getManifest("me/app", "v1")