Kentfield Times

Technology

Bun 1.2 Released: Major Update Brings Native PostgreSQL, S3 Support, and Enhanced Node.js Compatibility

By 3 min read
A picture of the Bun logo with the text 1.2

Bun, the all-in-one JavaScript runtime and toolkit, releases version 1.2 with significant improvements and new features

Ashcon Partovi and the Bun team have announced the release of Bun 1.2, marking a major milestone for the JavaScript runtime and development toolkit. This latest version introduces several groundbreaking features, including built-in PostgreSQL and S3 support, while significantly improving Node.js compatibility.

Native Database and Cloud Storage Integration

One of the most notable additions in Bun 1.2 is the introduction of Bun.sql, a built-in PostgreSQL client that promises up to 50% faster performance compared to traditional Node.js clients. The new API offers a straightforward interface for database operations using tagged template literals, complete with automatic prepared statements and connection pooling.

Additionally, Bun 1.2 introduces native S3 support through Bun.s3, allowing developers to interact with S3-compatible storage services directly. Early benchmarks show that Bun's S3 client performs up to 5x faster than the standard AWS SDK when downloading files.

Enhanced Node.js Compatibility

A picture of test results for Bun's Node.js compatibility, all tests being above 90%

Bun now passes over 90% of test cases for several core Node.js modules

The release brings significant improvements to Node.js compatibility, with Bun now passing over 90% of test cases for several core Node.js modules. The team has implemented support for critical features including:

  • Full HTTP/2 server support
  • UDP sockets through node:dgram
  • Cluster module for multi-core scaling
  • Improved zlib implementation with 2x performance gains

Package Management Improvements

A benchmark comparing Bun install to other alternatives

Upgrades to Bun install have made it 30% faster

Bun 1.2 introduces a new text-based lockfile format, bun.lock, replacing the previous binary format. This change makes it easier to review dependency changes in pull requests and resolve merge conflicts. Despite moving to a text-based format, the team reports that bun install is now 30% faster than in previous versions.

Looking Forward

"This release represents a major step forward in our mission to make JavaScript development faster and more efficient," says Jarred Sumner, Bun's creator. The team has also announced they are hiring engineers and designers in San Francisco to continue building the future of JavaScript tooling.

Bun 1.2 is available now and can be installed using:

curl -fsSL https://bun.sh/install | bash

Existing users can upgrade using:

bun upgrade

For more information about Bun 1.2 and its features, developers can visit the official Bun documentation at bun.sh.