Bun Config Builder

Bun Config Builder

Build bunfig.toml plus Bun-flavored package.json scripts, with a Node.js to Bun migration assistant.

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

Bun Config Builder is built for deterministic developer and agent workflows.

Build bunfig.toml plus Bun-flavored package.json scripts. Includes a Node.js to Bun migration assistant flagging the known incompatibility surface (sqlite, vm, cluster, etc.).

Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.

Last updated:

This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.

Agent Invocation

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 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.

Frequently Asked Questions

What is Bun Config Builder?
A generator for bunfig.toml plus a Bun-friendly package.json scripts block. It also includes a migration scanner that flags Node APIs known to diverge under Bun's runtime.
What does the migration scanner detect?
It pattern-matches the known ~5% incompatibility surface: node:vm, node:cluster, node:v8, node:perf_hooks edges, native .node addons, sqlite3 vs bun:sqlite, ts-node redundancy, and global.gc usage.
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.