New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bun-native

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-native

Use Bun as a package manager with React Native

latest
npmnpm
Version
0.1.8
Version published
Maintainers
1
Created
Source

bun-native

🌀 bun-native

⚡ Use Bun as a blazing-fast package manager with React Native projects.
This tool patches Metro and handles Bun-specific quirks so you can enjoy faster installs and cleaner dependencies.

🚀 Features

  • ✅ Metro bundler compatibility with Bun's symlinked dependencies
  • ✅ Generates a node_modules_mirror/ for clean Metro resolution
  • ✅ Patches metro.config.js automatically
  • ✅ Wrapper commands for run-ios, run-android, and start
  • ✅ Postinstall hook support for seamless integration

📦 Installation

Install globally via npm:

npm install -g bun-native

Make sure you have Bun installed

curl -fsSL https://bun.sh/install | bash

🧪 Usage

🆕 Initialize a New Project (React Native CLI)

bun-native init

Creates a new React Native project and installs everything using Bun.

📦 Customize the Project Name

You can pass a name to create your project:

bun-native init MyApp

🧪 Choose a Specific React Native Version

Use the --version flag to target a specific RN version:

bun-native init MyApp --version 0.78.1

✅ Migrate an Existing React Native Project

cd your-react-native-app

# Clean up old installs
rm -rf node_modules package-lock.json yarn.lock

# Install dependencies with Bun
bun install

# Patch Metro + Generate node_modules
bun-native postinstall

# Run the app
bun-native start
bun-native run-ios
bun-native run-android

🧠 How It Works

•	Uses Bun’s .bun/install/cache to generate a flat node_modules_mirror/ layout
•	Modifies metro.config.js to resolve modules from the mirror
•	Wraps npx react-native commands for convenience

🛠 Available Commands

CommandDescription
initInitialize a new React Native project using Bun
patch-metroPatch Metro to work with Bun
postinstallRun postinstall to patch Metro and create mirror layout
run-androidRun react-native run-android
run-iosRun react-native run-ios
startRun react-native start
bundleRun react-native bundle

⚠️ Known Limitations

•	Not yet compatible with all complex native modules — but works well for most.
•	Metro doesn’t fully support Bun’s symlink layout — hence the node_modules_mirror.

🤝 Contributing

Pull requests are welcome! Ideas, templates, and bug reports are also appreciated.

📜 License

MIT © 2025 Kologo B Josias Yannick

Buy me a coffee

If my you find my work usefull and want to support me, kindly buy me a coffee here

Keywords

bun

FAQs

Package last updated on 31 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts