Bun

Bun v1.0.25


Jarred Sumner ยท January 21, 2024

Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager โ€” all in one. In case you missed it, here are some of the recent changes to Bun.

This release fixes 4 bugs, adds vm.createScript. Fixes a crash in fs.readFile, a crash in Bun.file().text(), a crash in IPC, and a transpiler bug involving loose equals

Previous releases

  • v1.0.24 fixes 9 bugs and adds Bun Shell, a fast cross-platform shell with seamless JavaScript interop. Fixes a socket timeout bug, a potential crash when socket closes, a Node.js compatibility issue with Hapi, a process.exit bug, and bun install binlinking bug, bun inspect regression, and bun:test expect().toContain bug
  • v1.0.23 fixes 40 bugs (addressing 194 ๐Ÿ‘ reactions). import & embed sqlite databases in Bun, Resource Management ('using' TC39 stage3) support, bundler improvements when building for Node.js, bugfix for peer dependency resolution, semver bugfix, 4% faster TCP on linux, Node.js compatibility improvements and more"
  • v1.0.22 fixes 29 bugs (addressing 118 ๐Ÿ‘ reactions), fixes bun install issues on Vercel, adds performance.mark() APIs, adds child_process support for extra pipes, makes Buffer.concat faster, adds toBeEmptyObject and toContainKeys matchers, fixes console.table width using emojis, and support for argv and execArgv options in worker_threads, and supports Brotli in fetch.

To install Bun:

curl
npm
brew
docker
curl
curl -fsSL https://bun.sh/install | bash
npm
npm install -g bun
brew
brew tap oven-sh/bun
brew install bun
docker
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun

To upgrade Bun:

bun upgrade

Fixed: crash in fs.readFile

In certain cases, Bun would crash when reading a file with fs.readFile, fs.readFileSync, or fs.promises.readFile. This was caused by an unintiailized memory access introduced when Bun added support for standalone modules.

Fixed: crash in Bun.file().text()

A crash when reading a file with Bun.file().text() that had a Byte Order Mark has been fixed. This crash was introduced in Bun v1.0.24.

Fixed: crash in IPC

A crash in IPC that would occur 4-5 seconds after the process started has been fixed. This crash was introduced when upgrading our version of uSockets to gain "long timeout" support. The crash was a null-pointer dereference when calling the timeout callback.

Fixed: transpiler loose equality comparison bug

The following input would be constant-folded incorrectly:

"" == 0;
"-0" == 0;
1234n == 5678n;

This has been fixed, thanks to @dylan-conway.

vm.createScript

The node:vm function createScript has been added. This calls new vm.Script with the same arguments.

Windows is coming soon

10 days away.

Thanks to 5 contributors!