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

@stripe/bun-toolkit

v0.4.1

Published

Shared Bun binary infrastructure: asset embedding, manifest generation, and cross-compilation

Readme

@stripe/bun-toolkit

Internal use only. This package is published publicly for convenience but is intended for use by Stripe-internal projects. It is not supported for general community use and carries no stability guarantees for external consumers.

Shared Bun binary infrastructure: asset embedding, manifest generation, and cross-compilation.

What this provides

  1. Runtime module (@stripe/bun-toolkit/runtime) — getAssetDir() / resolveAsset() for transparent asset access in both dev and compiled binary modes
  2. Manifest generator (bun-generate-manifest) — reads bun.assets globs from package.json, generates a Bun compile entrypoint that embeds all assets
  3. Binary builder (bun-build-binaries) — full cross-compilation pipeline with version validation and target mapping

Usage

1. Configure assets in package.json

{
  "bun": {
    "assets": ["openapi/*.yaml", "assets/**"],
    "entry": "./dist/main.js",
    "buildScript": "prebuild-binary"
  }
}
  • assets — glob patterns for files to embed in the binary
  • entry — the JS entrypoint to re-export from the generated manifest
  • buildScript — (optional) package.json script to run before compilation. Defaults to "prebuild-binary". Skipped if the script doesn't exist.

2. Use the runtime in your code

import { resolveAsset } from "@stripe/bun-toolkit/runtime";

const specPath = resolveAsset("openapi/spec.yaml");

3. Build binaries

npx bun-build-binaries ./bin "macos-arm64,linux-x64"

How it works

Build time: bun-generate-manifest expands the asset globs and writes dist/bun-compile-entrypoint.js with import ... with { type: "file" } statements. This tells Bun to embed each file directly in the binary.

Binary mode: When the binary runs, globalThis.__EMBEDDED_ASSET_MANIFEST__ maps logical paths to Bun's virtual filesystem paths. getAssetDir() extracts all embedded files to a temp directory on first call. The temp directory is cleaned up on process exit.

Dev mode: When running via Node/tsx/bun without compilation, getAssetDir() returns the repo root where assets exist on disk. No extraction needed.

Scripts

  • pnpm build — compile TypeScript
  • pnpm test — run unit tests
  • ./scripts/smoke-test.sh — end-to-end test: builds a fixture into a binary and verifies embedded assets work from a foreign cwd