Migrate npm package.json to Bun Runtime & Scripts
Instantly migrate npm scripts, dependencies, and configurations to Bun. Optimize script execution speeds and strip obsolete transpilations.
{
"name": "enterprise-service",
"version": "1.0.0",
"scripts": {
"dev": "NODE_ENV=development bun src/server.ts",
"build": "tsc",
"start": "node dist/server.js",
"test": "bun run build && jest"
},
"dependencies": {
"express": "^4.19.2",
"dotenv": "^16.4.5"
},
"devDependencies": {
"typescript": "^5.4.5"
}
}Detected Breaking Changes & Semantic Shifts (2)
Bun executes TypeScript natively without requiring ts-node runtime transpilations.
Bun parses .env files automatically and supports cross-platform environment variables natively.
How to Migrate from npm / Node.js to Bun Runtime
- 1
Paste your package.json containing npm scripts and Node.js dependencies.
- 2
The migrator replaces `npm run` and `ts-node` with Bun native script invocation.
- 3
Obsolete build dependencies (ts-node, cross-env) are automatically flagged for removal.
- 4
Copy the optimized package.json and run `bun install` to generate bun.lock.
Run Tests on Bun in GitHub Actions
name: Bun CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun test
Run Migration via Terminal CLI
Perform identical migration routines across entire directories or repositories in your local terminal:
devflow migrate npm-to-bun -i package.jsonRelated DevOps & Stack Migrators
Migrate Jest Unit Tests to Vitest
Convert Jest test suites, configs, and mocks to Vitest. Share identical Vite configurations and execute tests 4x faster with ESM native workers.
Migrate Webpack 5 Config to Vite (10x Faster HMR)
Convert webpack.config.js bundles into lightning-fast Vite configs (vite.config.ts). Eliminate multi-minute cold starts and reload delays.
Associated DevFlow Tools
Frequently Asked Questions
- Will npm packages with native C++ addons work with Bun?
- Bun supports Node-API (N-API) natively, meaning the vast majority of native C++ modules compile and run without modification.
- What happens to package-lock.json?
- Running `bun install` generates Bun’s binary `bun.lock`. You can safely delete `package-lock.json` once you switch.