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

@zudojs/adapters

v1.0.0

Published

Boundary layer between Zudojs and external platforms — adapter contracts, registry, capabilities, and transport abstractions.

Readme

@zudojs/adapters

Boundary layer between Zudojs and external platforms with adapter contracts, registry, capabilities, and transport abstractions.

Installation

npm install @zudojs/adapters

Quick Start

import { AdapterRegistry } from "@zudojs/adapters";
import type { Adapter } from "@zudojs/adapters";

const registry = new AdapterRegistry();

const postgres: Adapter = {
  name: "postgres",
  version: "1.0.0",
  // Capabilities are a declaration object, not a list of method names.
  capabilities: { longRunning: true, gracefulShutdown: true },
  initialize: async () => {
    /* open the pool */
  },
  dispose: async () => {
    /* close the pool */
  },
};

registry.register(postgres);

registry.get("postgres"); // Adapter | undefined
registry.require("postgres"); // throws AdapterNotFoundError when absent

Names are case-insensitive: they are trimmed and lowercased for registration and lookup, and getNames() reports them in that form. A name that is blank after trimming is rejected with AdapterConfigurationError — it could never be looked up again. Registering the same name twice throws AdapterAlreadyRegisteredError.

Lifecycle

An adapter may implement initialize(), start(), stop() and dispose(). The registry drives them across everything it holds:

await registry.initializeAll(); // prepare resources
await registry.startAll(); // begin processing
await registry.stopAll(); // stop processing, stay registered
await registry.disposeAll(); // stop, dispose, and empty the registry

Each of these attempts every adapter and then throws an AggregateError carrying the failures, rather than stopping at the first one — a half-applied transition leaves resources nobody is tracking.

remove() and clear() only drop references; removeAndDispose() and disposeAll() also release resources.

Capabilities

Adapters declare what they support so runtime code can pick one that can do the job:

registry.findByCapability("http"); // every adapter declaring http
registry.supports("postgres", "gracefulShutdown"); // boolean, never throws
registry.requireCapability("edge", "streaming"); // throws AdapterCapabilityMissingError

Declared capabilities: http, websocket, streaming, filesystem, tcp, udp, backgroundTasks, longRunning, edgeRuntime, serverless, gracefulShutdown, abortSignal.

Health

import {
  createHealthyHealth,
  createDegradedHealth,
  createUnhealthyHealth,
} from "@zudojs/adapters";

const health = createDegradedHealth("replica lag above threshold");

A LifecycleAdapter adds optional configure(options) and health() to the base contract.

Transport contracts

Type-only interfaces that extend Adapter for each transport: HTTPAdapter, HTTPServerAdapter, MessageAdapter, StorageAdapter, QueueAdapter, RuntimeAdapter, WebSocketAdapter, CLIAdapter, SchedulerAdapter.

Testing utilities

import {
  createMockAdapter,
  createMockAdapterRegistry,
  createMockHealth,
} from "@zudojs/adapters";

const { registry } = createMockAdapterRegistry([
  createMockAdapter({ name: "fake-http", capabilities: { http: true } }),
]);

Errors

Re-exported from @zudojs/errors: AdapterError · AdapterNotFoundError · AdapterAlreadyRegisteredError · AdapterNotSupportedError · AdapterCapabilityMissingError · AdapterConnectionError · AdapterOperationError · AdapterTimeoutError · AdapterDisposeError · AdapterInitializationError · AdapterConfigurationError.

Use Cases

  • Database adapters
  • Message queue adapters
  • Cache adapters
  • External service integrations