Skip to content

Bun Config Builder

Build bunfig.toml and Bun package.json scripts from six presets, and scan Node code for APIs that behave differently under Bun, like vm and cluster.

Bun Config Builder

Runtime

JSX

Install

Test runner

Scripts preset

Custom additions
bunfig.toml
# bunfig.toml — generated

[jsx]
runtime = "automatic"
importSource = "react"

[install]

[test]

[run]
package.json
{
  "name": "my-bun-app",
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "bun run --hot src/index.ts",
    "start": "bun run src/index.ts",
    "test": "bun test"
  },
  "dependencies": {},
  "devDependencies": {
    "@types/bun": "latest"
  }
}

What this tool does

The Bun Config Builder generates a bunfig.toml and Bun-flavored package.json scripts from toggles for the runtime, install, test, and run sections, with presets for Node, Next, Vite, Astro, and Express. A second tab scans pasted Node.js source for the APIs that behave differently under Bun. It all runs in your browser. Note: the coverage threshold is written as a 0-to-1 fraction, not a percentage.

Updated . Provided as is. Check the output before you rely on it in production.

How to use Bun Config Builder

  1. 1

    Set runtime options

    Choose smol mode for low-memory environments, set logLevel, and add preload scripts. Configure JSX runtime for React, Preact, or other JSX import sources.

  2. 2

    Configure install behavior

    Set the registry, lockfile mode (binary, text, or none), frozen lockfile for CI, peer dependency installation, and production-only flags for deployment images.

  3. 3

    Tune the test runner

    Enable coverage with a percent threshold and reporter (text or lcov), set the per-test timeout, and add preload files like ./happydom.ts for DOM testing under bun:test.

  4. 4

    Pick a scripts preset

    Choose minimal, node, next, vite, astro, or express. Each preset wires a Bun-flavored set of dev, start, build, and test scripts. Add custom scripts for project-specific workflows.

  5. 5

    Run the migration scan

    Switch to the Migration tab and paste your Node source. The scanner flags vm, cluster, sqlite3, V8 internals, and other APIs that diverge under Bun, with a fix recommendation per finding.

Questions and answers

What is Bun Config Builder?
Bun is a JavaScript runtime, package manager and test runner that reads its settings from bunfig.toml. This builder writes bunfig.toml install, test and run sections plus a package.json scripts block from six presets, and scans pasted Node code for APIs that behave differently under Bun, each with a remedy.
What does the migration scanner detect?
Thirteen patterns: node:vm, node:cluster, child_process.fork, process.binding, native .node addons, worker_threads, __filename and __dirname in ESM, global.gc, node:v8, node:perf_hooks, WebAssembly, Jest and ts-node, tsx or esbuild-register. Each finding comes with a note and a remedy.
Which script presets are available?
Six: minimal, node (with biome), next (bunx --bun), vite, astro, and express. Each wires Bun-flavored dev/start/build/test commands. Custom scripts can be appended to any preset.
Does it send my data to a server?
No. The configuration builder and the migration scanner both run client-side. Your pasted source code stays in your browser memory and is never transmitted.
Where do these files go?
Save bunfig.toml at your project root (or in $HOME for global defaults). Merge the scripts block into your existing package.json. Bun reads bunfig.toml automatically on every command.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/bun-config-builder/

For automation planning, fetch the canonical contract at /api/tool/bun-config-builder.json.

How do I migrate a Node.js project to Bun?

Most Node.js code runs unchanged under Bun; the friction is a small set of APIs that behave differently or are missing. Paste your source into the migration tab and it scans for that surface, grading each hit as error, warning, or info with a concrete fix. On the config tab, generate the bunfig.toml and package.json scripts to complete the switch.

Step by step

  1. Open the Node to Bun Migration tab and paste a file or a concatenated codebase — it is analyzed in the page, never uploaded.
  2. Read the error / warning / info counts, then each finding's note, fix, and line numbers.
  3. Switch to the Config tab and pick a script preset (Node, Next, Vite, Astro, Express, or minimal).
  4. Toggle the runtime, install, test, and run options you need.
  5. Copy the generated bunfig.toml and package.json into your project.

Node APIs that differ under Bun (what this tool flags)

Node API / module Severity Under Bun
node:cluster error Not implemented; use Bun.serve with reusePort or multiple processes
node:vm error Partial; contextification incomplete
node:v8 error Unimplemented — Bun runs JavaScriptCore, not V8
process.binding error Internal Node binding not exposed; update the dependency
child_process.fork warn IPC-based fork partially implemented; prefer Bun.spawn
global.gc / --expose-gc warn No --expose-gc flag; use Bun.gc()
native .node addons warn N-API works; a few V8-internal addons will not load
worker_threads info Supported, with slightly different threading semantics

Rules as this tool's analyzer implements them (13 checks across core modules, runtime, globals, tooling, and wasm). Bun's compatibility moves fast, so always re-run your test suite after switching.

What does the bunfig.toml builder cover?

It writes the sections you toggle: [jsx] runtime and import source; [install] registry, lockfile, frozen lockfile, and auto-install mode; [test] coverage, threshold, reporter, and timeout; and [run] hot reload, shell, and silent. Only non-default values are emitted, so the file stays minimal.

How does the migration scanner work?

It strips comments and string literals — but keeps import and require specifiers — then matches your source against a rule set for the APIs that diverge under Bun, reporting matches with line numbers. It is a static scan, not an execution, so treat it as a checklist of things to verify rather than a guarantee.

Is my source code uploaded?

No. Both the config generation and the migration scan run entirely in your browser; the source you paste never leaves the tab. That lets you check a private or proprietary codebase for Bun compatibility without sending any of it to a server.