Bun is a fast all-in-one JavaScript runtime
https://bun.sh| Installer Source| Releases (json) (tab)
Bun is a fast all-in-one JavaScript runtime
https://bun.sh| Installer Source| Releases (json) (tab)
To update or switch versions, run webi bun@<tag>
.
(you can use @beta
for pre-releases, or @x.y.z
for a specific version)
These are the files / directories that are created and/or modified with this install:
~/.config/envman/PATH.env
~/.local/opt/bun/
~/.local/opt/bun-<VERSION>/
Bun is a wicked-fast JavaScript runtime for developer tooling, API servers, and edge computing.
It's built in Zig and provides a more curated, "batteries-included" approach to developing with JavaScript and JavaScript-ish languages - such as TypeScript, JSX, and TSX.
Run some xScript:
bun run ./hello.js
bun run ./hello.jsx
bun run ./hello.ts
bun run ./hello.tsx
Run a package from npm
:
bun x jswt
More goodies:
bun help
(there's also a built-in development server and lots of stuff)
Bun has an official installer:
export BUN_INSTALL="$HOME/.bun"
curl -fsSL https://bun.sh/install | bash
You might want to still use webi if you want to be able to switch between versions.
bun completions
vim ./hello
#!/usr/bin/env bun
console.log('hello');
chmod a+x ./hello
./hello
At the time of this writing (bun v0.5.1), you'll still need to publish with
npm
.
npm
is installed with node.
See Getting Started with NPM (as a developer).
You can run it with bun x
:
bun x <whatever>
Or you can put the #!/usr/bin/env bun
shebang before publishing, and install
from npm:
bun install -g <whatever>
<whatever>
As a system service on Linux:
(note: swap 'my-project' and './my-project' for the name of your project and file)
webi serviceman
source ~/.config/envman/PATH.env
pushd ./my-project/
sudo env PATH="$PATH" \
serviceman add --path="$PATH" --system \
--username "$(whoami)" --name my-project -- \
bun run ./my-project.js
sudo systemctl restart systemd-journald
For macOS:
launchctl
)webi serviceman
source ~/.config/envman/PATH.env
pushd ./my-project/
serviceman add --path="$PATH" --user --name my-project -- \
bun run ./my-project.js