New Features in Bun 1.2 - Full Windows Support and Node.js Compatibility Improvements

2025.12.12

Bun 1.2 Released

Bun, the high-speed JavaScript runtime gaining attention, has released version 1.2. With full Windows support, major Node.js compatibility improvements, and built-in S3 client, its practicality has further increased.

What is Bun: A high-speed JavaScript/TypeScript runtime written in Zig. Provides runtime, bundler, package manager, and test runner all-in-one.

Major New Features

1. Full Windows Support

Windows support, which was previously in beta, is now fully supported. The same features as macOS and Linux are available.

# Windows (PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"

# Or via npm
npm install -g bun

2. 92% Node.js Compatibility Achieved

Node.js API coverage has significantly improved. Most major npm packages now work.

ModuleSupport Status
node:fs / node:pathFully Supported
node:http / node:httpsFully Supported
node:cryptoNearly Fully Supported
node:net / node:tlsFully Supported
node:child_processFully Supported
node:worker_threadsFully Supported

3. Built-in S3 Client

Access to AWS S3 is now built-in. S3 operations are possible without external libraries.

// Read file from S3
const file = Bun.s3.file("s3://my-bucket/data.json");
const data = await file.json();

// Upload file to S3
await Bun.s3.write("s3://my-bucket/output.txt", "Hello S3!");

// Credentials automatically retrieved from environment variables
// AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY

4. Embedded Postgres

PostgreSQL client is now also built-in.

import { sql } from "bun";

// Connection is auto-managed
const users = await sql`
  SELECT * FROM users
  WHERE created_at > ${new Date('2025-12-01')}
`;

// Transaction
await sql.begin(async (sql) => {
  await sql`INSERT INTO logs (message) VALUES (${'Started'})`;
  await sql`UPDATE users SET status = 'active'`;
});

5. Text-based Lock File

bun.lock has changed from binary to text format. Diffs are now easier to see.

Performance Comparison

BenchmarkNode.js 22Deno 2.0Bun 1.2
Startup time~35ms~25ms~7ms
HTTP Server (req/s)~80,000~100,000~150,000
npm install (clean)~15sN/A~3s
File reading1.0x1.2x2.5x

Why is it fast: Bun uses the JavaScriptCore engine (same as Safari) and is optimized with Zig. Also, the package manager utilizes a global cache to minimize I/O.

Development Tool Enhancements

bun test Improvements

// Test file (app.test.ts)
import { describe, it, expect, mock } from "bun:test";

describe("Math operations", () => {
  it("should add numbers correctly", () => {
    expect(1 + 2).toBe(3);
  });

  it("should mock functions", () => {
    const fn = mock(() => 42);
    expect(fn()).toBe(42);
    expect(fn).toHaveBeenCalledTimes(1);
  });
});

// Execution
// bun test            # All tests
// bun test --watch    # Watch mode
// bun test --coverage # With coverage

Framework Support Status

FrameworkSupport StatusNotes
ElysiaFully SupportedBun-exclusive, fastest
HonoFully SupportedMulti-runtime
ExpressFully SupportedWorks via compatibility
FastifyFully SupportedOfficial support from v5
Next.jsExperimentalSome feature limitations
NuxtSupportedNitro preset

Elysia Example

import { Elysia } from 'elysia';

const app = new Elysia()
  .get('/', () => 'Hello Bun!')
  .get('/user/:id', ({ params: { id } }) => {
    return { id, name: 'User ' + id };
  })
  .post('/json', ({ body }) => body)
  .listen(3000);

console.log(`Running at ${app.server?.hostname}:${app.server?.port}`);

Migration Tips

Migration from Node.js

# 1. package.json works as-is
bun install

# 2. Running scripts
bun run dev          # package.json scripts
bun run src/index.ts # Direct execution

# 3. Environment variables
# .env files are automatically loaded

# 4. Type checking is separate
bun x tsc --noEmit

Notes

  • Some native modules (node-gyp) may not work
  • Next.js App Router is not fully supported
  • Production adoption should be judged case by case

Summary

Bun 1.2 is a release with significantly improved practicality. Key points:

  • Full Windows support: Cross-platform development made easy
  • 92% Node.js compatibility: Most npm packages work
  • Built-in features: Reduce external dependencies for S3, Postgres, etc.
  • Overwhelming speed: Startup, execution, and package management are all fast

For new projects or use cases where performance is critical, Bun is worth actively considering.

← Back to list