https://github.com/tobua/go-bun
Point the Node.js JavaScript Runtime executable to Bun to ensure code runs with Bun.
https://github.com/tobua/go-bun
Last synced: 22 days ago
JSON representation
Point the Node.js JavaScript Runtime executable to Bun to ensure code runs with Bun.
- Host: GitHub
- URL: https://github.com/tobua/go-bun
- Owner: tobua
- Created: 2024-08-24T15:00:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-22T18:42:12.000Z (7 months ago)
- Last Synced: 2025-04-21T07:10:31.940Z (about 1 month ago)
- Language: TypeScript
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-bun
Bun aims to be a compatible JavaScript runtime with Node.js. Since the ecosystem is largely built on top of Node.js scripts will often switch to be executed with Node.js in the background. This small plugin will make it easy to point the **node** executable to **bun** so that you can be sure everything runs with Bun. While compatibility can still be an issue it's also easy to restore the node exectuable.
```sh
bun install -g go-bun # Global installation
sudo bunx go-bun # One-time usage
```The following commands are available to switch and verify executables.
```sh
# Link "node", "npm" and "npx" executables to Bun.
sudo go-bun / sudo bunx go-bun
# Link "node", "npm" and "npx" back to Node.js.
sudo go-node / sudo bunx go-bun go-node
# Check where current executables point to.
check-runtime / bunx go-bun check-runtime
```Once switched anything should run with Bun also bin scripts with the `#!/usr/bin/env node` shebang or `execSync('node index.js')` somewhere deep down in the code.