Paul Krill
Editor at Large

Bun JavaScript runtime is in the oven

news
Oct 3, 20222 mins

Bun is a JavaScript runtime built on the JavaScriptCore engine with a native bundler, transpiler, task runner, and NPM client built-in.

19 thanks kingsofpastry jma
Credit: First Run Features

Move over, Node.js and Deno. A potential competitor is emerging in the JavaScript/TypeScript runtime space, called Bun.

Now in a beta stage of development, Bun is billed as a modern JavaScript runtime akin to Deno or Node, built to start fast, offer new levels of performance, and be a complete tool, equipped with a bundler, transpiler, and package manager. Bun also features an NPM client that implements the Node module resolution algorithm.

Bun has ambitions. The goal of the project is to “run most of the world’s JavaScript outside of browsers,” providing performance and complexity enhancements to future infrastructure. Developer productivity and simpler tools also are goals. The project claims to support 90% of Node-API functions. Built-in web APIs include fetch, WebSocket, and ReadableStream.

Instructions on getting started with Bun can be found on the project website. Bun was designed as a drop-in replacement for current JavaScript and TypeScript apps and scripts on a local computer, server, or on the edge. Hundreds of Node.js and web APIs are implemented natively.

Written in the Zig low-level programming language, the Bun runtime uses the JavaScriptCore engine from the WebKit project, which Bun developers said tends to perform faster than “traditional choices like V8,” which is used by both Node.js and Deno. Most of Bun was written from scratch, including clients for NPM, SQLite, HTTP, and WebSocket, as well as the JSX/TypeScript transpiler.

To make Bun fast, the developers spent time profiling, benchmarking, and optimizing. Zig’s low-level control over memory and transparent control flow make it simpler to write fast software, the developers said.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author