bun-migrate
Migrate existing Node.js/npm projects to Bun
- 0
- Installs
- —
- Rating
- —
- Success rate
- 1
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 60b9d2b46caf3a44… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
bun-migrate.md
Migrate to Bun
Migrate an existing Node.js project to use Bun as runtime and package manager.
Migration Steps
1. Analyze Current Project
Check for:
- Current package manager (package-lock.json, yarn.lock, pnpm-lock.yaml)
- Node.js version requirements
- Native dependencies
- Scripts that use Node-specific features
- Test framework (Jest, Mocha, Vitest)
2. Package Manager Migration
# Remove old lockfiles
rm -f package-lock.json yarn.lock pnpm-lock.yaml
# Install with Bun
bun install
3. Update Scripts
Replace in package.json:
| Before | After |
|---|---|
node script.js | bun script.js |
ts-node script.ts | bun script.ts |
npx command | bunx command |
npm run | bun run |
jest | bun test |
vitest | bun test |
4. Configuration Files
Create or update:
bunfig.toml
[install]
auto-install = true
[run]
bun = true
5. Test Migration
For Jest projects:
# Update imports
# Before: import { describe, it } from '@jest/globals'
# After: import { describe, test } from 'bun:test'
# Run tests
bun test
6. TypeScript Configuration
Update tsconfig.json:
{
"compilerOptions": {
"types": ["bun-types"]
}
}
Install types:
bun add -D bun-types
Compatibility Checks
Node.js APIs
| API | Bun Support |
|---|---|
| fs | ✅ Full |
| path | ✅ Full |
| http/https | ✅ Full |
| crypto | ✅ Full |
| child_process | ✅ Full |
| worker_threads | ✅ Full |
| stream | ✅ Full |
Potential Issues
- Native addons - May need recompilation
- Node.js-specific env vars - Check for NODE_* variables
- Babel/webpack configs - Usually not needed with Bun
- Jest configs - Convert to bunfig.toml
Rollback Plan
If migration fails:
# Restore old lockfile
git checkout package-lock.json
# Remove Bun lockfile
rm bun.lockb
# Reinstall with npm
npm install
Questions to Ask
- "Do you have any native Node.js addons?"
- "Are you using Jest for testing?"
- "Do you need to maintain Node.js compatibility?"
Output
After migration:
- List of changes made
- Any incompatibilities found
- Recommended next steps
- Performance comparison (if possible)
Files
1- bun-migrate.md
46f29676d42.4 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from secondsky/claude-skills8
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
Run a focused blindspot pass for unfamiliar, ambiguous, or high-risk work
Debug Bun applications and diagnose common issues
Deploy Bun applications to various platforms
Initialize a new Bun project with optional framework selection
Optimize Bun application performance and bundle size
Upgrade Bun runtime and project dependencies