An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

        

# go-bun

Bun/Node.js logo

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.