logo
bg
return Blog

April 2, 2024

What's New in Bun v1.1

Yuhang XiaYuhang Xia

Bun is a fast, all-in-one toolkit for running, building, testing, and debugging JavaScript and TypeScript, from a single script to a full-stack application.

Now Bun v1.1 has released at April 1st, let’s explore what’s new in Bun v1.1.

Get Started with Bun

Installing Bun is quite similar to install Node.js. All you need to do is:

  • Download the installer package from the official Bun website.
  • Once you have downloaded the installer, run it and follow the instructions to complete the installation process.
  • Start your first Bun project using Bun CLI.

What’s New in v1.1?

  • Windows Support
  • Speed Improvement
  • New File Format
  • Bun Shell
  • Bugs Fixed and Stability Improvements

Windows Support

Exciting news for Windows 10 users and beyond—Bun is now available for your platform! This marks a significant leap forward, opening up opportunities for a broader developer community to utilize Bun.

Bun's compatibility with Windows is robust, successfully passing 98% of the tests we use for macOS and Linux. This comprehensive coverage ensures that the full suite of Bun's capabilities—runtime, test runner, package manager, and bundler—are fully operational on Windows.

Ready to dive in with Bun on your Windows machine? Simply input the following command into your terminal to begin: > powershell -c "irm bun.sh/install.ps1 | iex"

Speed Improvement

Bun seamlessly integrates with JavaScript, TypeScript, and JSX thanks to its custom-built transpiler, which is crafted from highly efficient native code for optimal performance.

From the release of Bun 1.0, a specialized caching system has been in place for files exceeding 50KB, eliminating unnecessary re-transpilation and thereby enhancing speed and efficiency.

As a result of these innovations, command-line utilities such as tsc now execute up to twice as swiftly compared to their performance in Bun 1.0.

Bun Shell

The Bun Shell has been transformed into a cross-platform shell, accessible not only on Unix-like systems but also on Windows, akin to bash.

Why should scripting with JavaScript, the most ubiquitous scripting language, be fraught with complexity? Bun simplifies the process.

New File Format

To make bun run faster on Windows, Bun team has engineered a new file-format: .bunx.

The .bunx file serves as a universal symlink, functioning across different file systems to launch scripts or executables via Bun or Node.js. This innovation was driven by multiple factors:

  • The unreliability of traditional symlinks on Windows systems.
  • The inability of Windows to recognize shebangs (e.g., #!/usr/bin/env bun) at the start of files.
  • Our goal to streamline the process by eliminating the need for three separate types of executable files: .cmd, .sh, and .ps1.
  • Our desire to bypass the often confusing prompts asking to "Terminate batch job? (Y/n)".

Summary

Bun 1.1 is a significant update to the fast and versatile JavaScript and TypeScript toolkit, introducing Windows support, new APIs like Bun.Glob and Bun.Semver, enhanced features such as IPC support, and improvements in performance and stability.