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

@easydeploy/bnfn

v0.1.1

Published

Bun-native Axios-shaped HTTP client backed by required Zig primitives

Downloads

216

Readme

bnfn

bnfn is a Bun-native HTTP client with an Axios-shaped API and a required Zig primitive layer.

It is intended to run in one supported mode only:

  • Bun runtime
  • built Zig native library

It is not a full Axios reimplementation. The current scope is:

  • Callable default export: bnfn(url, config?)
  • Instance API: create(), request(), get(), post(), put(), patch(), delete(), head(), options()
  • Request and response interceptors
  • Config merging and baseURL/params support
  • Header normalization through AxiosHeaders
  • Bun fetch transport
  • Required Zig acceleration for RFC 3986 percent-encoding and bulk query-entry serialization

Install

npm install @easydeploy/bnfn

npm install builds the Zig native library during postinstall. If zig is missing or the native build fails, installation fails.

The runtime-compatibility design and the latest benchmark output are documented in docs/compatibility-performance.md.

Project architecture, file layout, and the TypeScript surface are documented in docs/project.md.

Why this shape

Axios spends a meaningful amount of CPU time on object plumbing before network I/O: config merging, header normalization, and query serialization. This project keeps the higher-level API in JavaScript while pushing the bulk string/query work that benefits from native execution down into Zig, with no JavaScript fallback path for the supported Bun+Zig runtime.

Native layer

The native layer is required. Importing bnfn without Bun FFI or without a built native library is considered a setup error.

That means:

  • Bun with a built library: supported
  • Bun without a built library: unsupported
  • Node: unsupported

Build the Zig library:

npm run build:native

Inspect native status:

npm run inspect:native

Run the axios comparison benchmark:

bun run bench:axios

Benchmark against an explicit axios installation:

bun run bench:axios -- --axios-root=/path/to/node_modules/axios

The benchmark resolves axios from the current project by default, or from --axios-root when you want to compare against another install. It compares bnfn against axios on:

  • mergeConfig
  • AxiosHeaders.from()/set()/toJSON()
  • getUri(baseURL + params)

It also benchmarks the full client request pipeline with a no-op adapter through the public client API.

The build emits one of:

  • native/libbunxios_primitives.dylib
  • native/libbunxios_primitives.so
  • native/libbunxios_primitives.dll

TypeScript

The runtime source stays in JavaScript, but the package now ships index.d.ts as its public type surface.

That gives Bun/TypeScript consumers typed access to:

  • the callable default export
  • request config and response shapes
  • AxiosHeaders, AxiosError, and interceptor APIs
  • native status inspection via native()

Usage

import bnfn from "@easydeploy/bnfn";

const api = bnfn.create({
  baseURL: "https://example.com/api",
  headers: {
    common: {
      Accept: "application/json"
    }
  }
});

api.interceptors.request.use((config) => {
  config.headers = {
    ...(config.headers ?? {}),
    "x-runtime": "bun"
  };
  return config;
});

const response = await api.get("/users", {
  params: {
    page: 1,
    q: "bun zig"
  }
});

console.log(response.data);

Limits

  • Bun-only runtime
  • Native Zig library is required
  • No browser or Node runtime support
  • Not all Axios edge cases are implemented