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

@bunny.net/openapi-client

v0.1.1

Published

Standalone, type-safe OpenAPI client for [bunny.net](https://bunny.net). Zero CLI dependencies. Built on `openapi-fetch` with types generated from bunny.net's OpenAPI specs.

Readme

@bunny.net/openapi-client

Standalone, type-safe OpenAPI client for bunny.net. Zero CLI dependencies. Built on openapi-fetch with types generated from bunny.net's OpenAPI specs.

Installation

bun add @bunny.net/openapi-client

Usage

import { createCoreClient } from "@bunny.net/openapi-client";

const client = createCoreClient({
  apiKey: "bny_xxxxxxxxxxxx",
});

const { data } = await client.GET("/pullzone");
console.log(data?.Items);

Clients

Each client is scoped to a specific bunny.net API domain:

| Client | Factory | Base URL | | ---------------- | ---------------------------- | -------------------------------------- | | Core API | createCoreClient() | https://api.bunny.net | | Edge Scripting | createComputeClient() | https://api.bunny.net | | Database | createDbClient() | https://api.bunny.net/database | | Magic Containers | createMcClient() | https://api.bunny.net/mc | | Origin Errors | createOriginErrorsClient() | https://cdn-origin-logging.bunny.net | | Shield | createShieldClient() | https://api.bunny.net | | Storage | createStorageClient() | https://storage.bunnycdn.com | | Stream | createStreamClient() | https://video.bunnycdn.com |

Storage is region-specific — pass baseUrl (e.g. https://la.storage.bunnycdn.com) to target a non-default region. The apiKey should be the Storage Zone password.

Stream expects a per-library Stream API key as apiKey, not the account-wide key.

All clients accept a ClientOptions object:

interface ClientOptions {
  apiKey: string;
  baseUrl?: string;
  verbose?: boolean;
  userAgent?: string;
  onDebug?: (msg: string) => void;
}

Error Handling

Non-OK responses are automatically converted to ApiError by the built-in middleware. You never need to check status codes manually.

import { ApiError, UserError } from "@bunny.net/openapi-client";

try {
  await client.GET("/pullzone/{id}", {
    params: { path: { id: 999 } },
  });
} catch (err) {
  if (err instanceof ApiError) {
    console.error(err.message, err.status);
  }
}
  • UserError — expected errors (bad input, missing config). Has an optional hint property.
  • ApiError — extends UserError. Carries status, optional field, and optional validationErrors[].

Generated Types

TypeScript types are generated from OpenAPI specs via openapi-typescript. Access them through the generated export:

import type { components } from "@bunny.net/openapi-client/generated/core.d.ts";

type PullZone = components["schemas"]["PullZone"];

Available type modules:

  • @bunny.net/openapi-client/generated/core.d.ts
  • @bunny.net/openapi-client/generated/compute.d.ts
  • @bunny.net/openapi-client/generated/database.d.ts
  • @bunny.net/openapi-client/generated/magic-containers.d.ts
  • @bunny.net/openapi-client/generated/origin-errors.d.ts
  • @bunny.net/openapi-client/generated/shield.d.ts
  • @bunny.net/openapi-client/generated/storage.d.ts
  • @bunny.net/openapi-client/generated/stream.d.ts

Updating Specs

cd packages/openapi-client
bun run update-specs    # Downloads latest specs + regenerates types
bun run generate        # Regenerate types from existing specs