JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q48446F
  • License MIT

Use Bun as a package manager with React Native

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bun-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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

    Command Description
    init Initialize a new React Native project using Bun
    patch-metro Patch Metro to work with Bun
    postinstall Run postinstall to patch Metro and create mirror layout
    run-android Run react-native run-android
    run-ios Run react-native run-ios
    start Run react-native start
    bundle Run 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

    Buy Me A Coffee