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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dfatwork-pkgs/oci-client

v0.15.0

Published

Node.js bindings for rust-oci-client - OCI Distribution client

Readme

Node.js Bindings for rust-oci-client

Node.js bindings for the rust-oci-client library, providing high-performance OCI Distribution client functionality.

Features

  • Pure API Mirror: Function signatures match the native Rust functions exactly
  • High Performance: Uses NAPI-RS for zero-copy data transfer where possible
  • Full Auth Support: Anonymous, Basic (username/password), and Bearer token authentication
  • Complete ClientConfig: All native configuration options exposed
  • TypeScript Support: Full type definitions included

Installation

npm install @dfatwork-pkgs/oci-client
# or
yarn add @dfatwork-pkgs/oci-client

Usage

import { OciClient, anonymousAuth, basicAuth } from '@dfatwork-pkgs/oci-client';

// Create a client with default configuration
const client = new OciClient();

// Or with custom configuration
const clientWithConfig = OciClient.withConfig({
  protocol: 'Https',
  acceptInvalidCertificates: false,
  maxConcurrentDownload: 8,
  maxConcurrentUpload: 8,
});

// Pull an image
const imageData = await client.pull(
  'ghcr.io/example/image:latest',
  anonymousAuth(),
  ['application/vnd.oci.image.layer.v1.tar+gzip']
);

console.log(`Pulled ${imageData.layers.length} layers`);
console.log(`Digest: ${imageData.digest}`);

// Push an image
const response = await client.push(
  'registry.example.com/myimage:v1',
  layers,
  config,
  basicAuth('username', 'password'),
  null // Let the client generate the manifest
);

console.log(`Manifest URL: ${response.manifestUrl}`);

// Pull image manifest
const { manifest, digest } = await client.pullImageManifest(
  'ghcr.io/example/image:latest',
  anonymousAuth()
);

// Push a manifest list (multi-platform image)
const manifestUrl = await client.pushManifestList(
  'registry.example.com/myimage:v1',
  basicAuth('username', 'password'),
  imageIndex
);

// Pull referrers (OCI 1.1)
const referrers = await client.pullReferrers(
  'ghcr.io/example/image@sha256:abc123...',
  'application/vnd.example.sbom'
);

API Reference

Client

new OciClient()

Create a client with default configuration.

OciClient.withConfig(config: ClientConfig)

Create a client with custom configuration.

Authentication

anonymousAuth()

Create anonymous authentication.

basicAuth(username: string, password: string)

Create HTTP Basic authentication.

bearerAuth(token: string)

Create Bearer token authentication.

Main Functions

pull(image, auth, acceptedMediaTypes)

Pull an image from the registry. Returns ImageData with layers as Buffers.

push(imageRef, layers, config, auth, manifest?)

Push an image to the registry. Returns PushResponse.

pullImageManifest(image, auth)

Pull an image manifest. Returns { manifest, digest }.

pushManifestList(reference, auth, manifest)

Push a manifest list (image index). Returns manifest URL.

pullReferrers(image, artifactType?)

Pull referrers for an artifact. Returns ImageIndex.

Types

See the TypeScript definitions for complete type information.

Building from Source

# Install dependencies
yarn install

# Build native module (release)
yarn build

# Build debug version
yarn build:debug

# Run tests
yarn test

# Lint
yarn lint

Supported Platforms

  • Windows x64 (MSVC)
  • macOS x64 (Intel)
  • macOS ARM64 (Apple Silicon)
  • Linux x64 (glibc)
  • Linux ARM64 (glibc)
  • Linux x64 (musl/Alpine)
  • Linux ARM64 (musl/Alpine)

License

Apache-2.0