Bun 1.1 released with Windows support, stable WebSocket client and more

Bun 1.1 released with Windows support, stable WebSocket client and more

Bun – a bundler and runtime for JavaScript and TypeScript – was this week updated to version 1.1, now with Windows support and other fresh features.

This follows the September 2023 release of Bun 1.0, at which time Windows support remained experimental, limiting its take-up.

The team now states that Bun 1.1 runs on Windows 10 and later, though it passes only 98 percent of the test suite for macOS and Linux. Bun requires x64 and does not run on Arm builds of Windows. “We’ll add cross-compilation support and Windows arm64 eventually. I don’t expect much difficulty from Windows ARM once we figure out how to get JSC to compile on that platform. We support Linux ARM64 and macOS arm64,” said Bun creator Jarred Sumner.

As part of this release, Bun includes a new file type, .bunx, described as a “cross-filesystem symlink that is able to start scripts or executables using Bun or Node.js.” The rationale is to avoid creating different scripts for Windows terminal, PowerShell, and shell scripts.

Bun 1.1 on Windows

Bun itself is also a shell, implementing a bash-like programming language. A Bun shell script is executed using: bun run my-script.sh. The idea is that these scripts will run cross-platform without requiring any additional libraries.

Another theme of this release is improved Node.js compatibility. Some packages which previously did not work now do, including playwright, puppeteer, tensorflowjs, jsonwebtoken, bcrypt, and argon.

Bun’s WebSocket client, previously experimental, is now stable after fixing “dozens of bugs,” according to the introductory post.

The built-in bun test framework is also updated in 1.1, with more expect() methods, and module mocking for both CommonJS and ESM (ECMAScript) modules.

How is Bun doing? Development continues at a rapid clip, sometimes resulting in unexpected behavior; some early adopters of Bun 1.1 on Windows have reported bugs such as crashes or directory separator issues; but the team is in general responsive with fixes, and a high level of activity on Bun’s GitHub repository shows that the project has momentum.

“My experience with using Bun in side projects has been good. The built-in APIs work well in my experience, and I hope popular runtimes adopt at least a subset of them. The hashing and the SQLite bindings come to mind as APIs that I wish were available in Deno and Node.js as well,” said one developer on Hacker News.

Bun is relatively new though, and compatibility with Node.js is not complete. “The Next.js App.Router currently relies on Node.js APIs that Bun does not yet implement,” for example. Some developers are hitting errors because of Bun’s lack of maturity. “I’ve tried it like 3 times in span of last year with different projects only to find out it segfaults at runtime or when installing [a] package,” said one.

Despite such issues there is plenty of enthusiasm for Bun and what it can do. “You replace node, npm, tsx, jest, nodemon and esbuild with one single integrated tool that’s faster than all of the others,” commented an enthusiast; as the project stabilizes it is likely to attract increased adoption.