Bun v1.3.6 Here is a factual summary of the article: Bun version 1.3.6 introduces three new built-in APIs. The `Bun.Archive` API allows for creating and extracting tar archives with optional gzip compression directly in JavaScript, while `Bun.JSONC.parse()` provides native support for parsing JSON files that contain comments and trailing commas. Additionally, `Bun.build()` now supports `metafile` and `files` options, enabling detailed bundle analysis and the inclusion of virtual files during the build process. To install Bun curl -fsSL https://bun.sh/install | bash npm install -g bun powershell -c "irm bun.sh/install.ps1|iex" scoop install bun brew tap oven-sh/bun brew install bun docker pull oven/bun docker run --rm --init --ulimit memlock=-1:-1 oven/bun To upgrade Bun bun upgrade Bun.Archive API creates & extracts tarballs Bun.Archive API creates & extracts tarballsBun now includes a built-in Bun.Archive API for creating and extracting tar archives with optional gzip compression. This provides a fast, zero-dependency way to work with tarballs directly in JavaScript. js // Create an archive from files const archive = new Bun.Archive { "hello.txt": "Hello, World ", "data.json": JSON.stringify { foo: "bar" } , "binary.bin": new Uint8Array 1, 2, 3, 4 , } ; // Or get as Blob/Uint8Array const blob = await archive.blob ; const bytes = await archive.bytes ; // Or read files: const files = await archive.files ; const text = await archive.files " .{txt,json}" ; // Extract an existing tarball const tarball = new Bun.Archive await Bun.file "package.tar.gz" .bytes ; const fileCount = await tarball.extract "./output-dir" ; console.log Extracted ${fileCount} files ; // Enable gzip compression .tar.gz const compressed = new Bun.Archive files, { compress: "gzip" } ; // Gzip with custom compression level 1-12 const maxCompression = new Bun.Archive files, { compress: "gzip", level: 12 } ; You can write archives to local files: // Write to local file await Bun.write "archive.tar", archive ; await Bun.write "archive.tar.gz", compressed ; Or even to S3: // Write to S3 await Bun.write "s3://bucket/archive.tar.gz", compressed ; await s3Client.write "archive.tar.gz", compressed ; The API supports creating archives from objects, Blob , TypedArray , or ArrayBuffer inputs. Async operations run on Bun's worker pool threads for non-blocking I/O. Read more about Bun.Archive in Bun's docs https://bun.com/docs/runtime/archive Bun.JSONC API for parsing JSON with comments Bun.JSONC API for parsing JSON with commentsBun now provides a native Bun.JSONC.parse API for parsing JSONC JSON with Comments — the format used by tsconfig.json , VS Code settings, and many other configuration files. This allows you to parse JSON that includes: - Single-line comments // - Block comments / / - Trailing commas in objects and arrays js const config = Bun.JSONC.parse { // Database configuration "host": "localhost", "port": 5432, "options": { "ssl": true, // trailing comma allowed }, } ; console.log config.host ; // "localhost" This is useful when reading tsconfig.json files, VS Code configuration, or any JSON files that use the relaxed JSONC format — without needing a third-party library. metafile in Bun.build metafile in Bun.build Bun.build now supports the metafile option, matching esbuild's format for seamless compatibility with existing bundle analysis tools. When enabled, the build result includes detailed metadata about all input files, output chunks, their sizes, imports, and exports—perfect for bundle size tracking, dependency visualization, and CI integration. js const result = await Bun.build { entrypoints: "./src/index.ts" , outdir: "./dist", metafile: true, } ; // Analyze bundle sizes for const path, meta of Object.entries result.metafile.inputs { console.log ${path}: ${meta.bytes} bytes ; } for const path, meta of Object.entries result.metafile.outputs { console.log ${path}: ${meta.bytes} bytes ; } // Save for external tools like esbuild's bundle analyzer await Bun.write "./dist/meta.json", JSON.stringify result.metafile ; From the CLI: bun build ./src/index.ts --outdir ./dist --metafile ./dist/meta.json The metafile structure includes: : Map of source files with byte sizes, imports with kind, path, and whether external , and module format inputs : Map of output chunks with byte sizes, contributing inputs, imports, exports, entry points, and associated CSS bundles outputs files in Bun.build files in Bun.build Bun.build now supports a files option that lets you bundle virtual files that don't exist on disk, or override the contents of files that do exist. js const result = await Bun.build { entrypoints: "/app/index.ts" , files: { "/app/index.ts": import { greet } from "./greet.ts"; console.log greet "World" ; , "/app/greet.ts": export function greet name: string { return "Hello, " + name + " "; } , }, } ; In-memory files take priority over files on disk, so you can override specific files while keeping the rest of your codebase unchanged: await Bun.build { entrypoints: "./src/index.ts" , files: { // Override config.ts with production values "./src/config.ts": export const API URL = "https://api.production.com"; export const DEBUG = false; , }, outdir: "./dist", } ; Real files on disk can import virtual files, and virtual files can import real files—useful for code generation, injecting build-time constants, or testing with mock modules: // ./src/index.ts exists on disk and imports "./generated.ts" await Bun.build { entrypoints: "./src/index.ts" , files: { "./src/generated.ts": export const BUILD ID = "${crypto.randomUUID }"; export const BUILD TIME = ${Date.now }; , }, outdir: "./dist", } ; File contents can be provided as string , Blob , TypedArray , or ArrayBuffer . --compile-executable-path CLI flag --compile-executable-path CLI flagWhen cross-compiling single-file executables with bun build --compile , Bun normally downloads the target platform's Bun executable from npm. The new --compile-executable-path flag lets you specify a local Bun executable instead. This is useful for air-gapped environments, custom Bun builds, or when you want to avoid network requests during compilation. bun build --compile --target=bun-linux-x64 \ --compile-executable-path=/path/to/bun-linux-x64 app.ts This exposes the executablePath option that was already available in the JavaScript API: await Bun.build { entrypoints: "./app.ts" , compile: true, target: "bun-linux-x64", executablePath: "/path/to/bun-linux-x64", } ; reactFastRefresh option in Bun.build reactFastRefresh option in Bun.build The Bun.build API now supports the reactFastRefresh option, matching the existing --react-fast-refresh CLI flag. js const result = await Bun.build { reactFastRefresh: true, entrypoints: "src/App.tsx" , target: "browser", } ; When enabled, the bundler injects React Fast Refresh transform code $RefreshReg$ , $RefreshSig$ into the output. This enables hot module replacement for React components without needing a separate plugin. Response.json object is now 3.5x faster Response.json object is now 3.5x faster Response.json was significantly slower than manually calling JSON.stringify + new Response . This has been fixed by triggering JavaScriptCore's SIMD-optimized FastStringifier code path. js const obj = { items: Array.from { length: 100 }, , i = { id: i, value: item-${i} } , }; // Now both approaches have equivalent performance Response.json obj ; new Response JSON.stringify obj ; Before: Response.json : 2415ms JSON.stringify + Response : 689ms Ratio: 3.50x slower After: Response.json : ~700ms JSON.stringify + Response : ~700ms Ratio: ~1.0x parity 15% faster async/await 15-faster-async-await In the next version of Bun & Safari — Bun @bunjavascript async/await gets 15% faster, thanks to @Constellation pic.twitter.com/5htdmB0NqB December 24, 2025 30% faster Promise.race 30-faster-promise-race In the next version of Bun & Safari — Bun @bunjavascript Promise.race gets 30% faster thanks to @ sosukesuzuki pic.twitter.com/LWGQiF3UOR December 24, 2025 Faster faster-buffer-indexof Buffer.indexOf Buffer.indexOf Buffer.indexOf and Buffer.includes now use SIMD-optimized search functions, providing significant speedups when searching for patterns in large buffers. In a simple benchmark, this makes it up to 2x faster: ❯ bun bench/snippets/buffer-includes.js Run 99,999 times with a warmup: 21.90ms 44,500 bytes .includes true 1.42s 44,500 bytes .includes false ❯ bun-1.3.5 bench/snippets/buffer-includes.js Run 99,999 times with a warmup: 25.52ms 44,500 bytes .includes true 3.25s 44,500 bytes .includes false js const buffer = Buffer.from "a".repeat 1 000 000 + "needle" ; // Both methods are now faster with SIMD acceleration buffer.indexOf "needle" ; // single and multi-byte patterns buffer.includes "needle" ; Faster embedded faster-embedded-node-files-on-linux .node files on Linux .node files on LinuxIn the next version of Bun — Jarred Sumner @jarredsumner Single-file executables load large embedded .node napi addons slightly faster on Linux pic.twitter.com/RgQVj4bzEf December 20, 2025 Faster IPC faster-ipc In the next version of Bun — Jarred Sumner @jarredsumner 9x faster cross-process JSON IPC with large messages pic.twitter.com/aFUa3NmKLm December 29, 2025 Faster faster-bun-spawnsync-on-linux-arm64 Bun.spawnSync on Linux ARM64 Bun.spawnSync on Linux ARM64Fixed a performance regression where Bun.spawnSync was up to 30x slower than expected on Linux systems with high file descriptor limits. The issue occurred because the close range syscall number wasn't being defined at compile time on older glibc versions, causing Bun to fall back to iterating through all possible file descriptors up to 65K individually: js // Before: ~13ms per spawn with default ulimit for let i = 0; i < 100; i++ Bun.spawnSync "true" ; // After: ~0.4ms per spawn for let i = 0; i < 100; i++ Bun.spawnSync "true" ; --grep flag for bun test --grep flag for bun test bun test now supports --grep as an alias for --test-name-pattern , matching the familiar flag used by Jest, Mocha, and other test runners. All of these are now equivalent: bun test --grep "should handle" bun test --test-name-pattern "should handle" bun test -t "should handle" Faster JSON serialization across Bun APIs faster-json-serialization-across-bun-apis JSON serialization is now ~3x faster for several internal APIs by using JSC's SIMD-optimized FastStringifier code path: — faster debugging output console.log with %j format PostgreSQL JSON/JSONB types — faster database operations MySQL JSON type — faster database operations Jest — faster test output %j / %o format specifiers Fake Timers Now Work with fake-timers-now-work-with-testing-library-react @testing-library/react @testing-library/react jest.useFakeTimers now works correctly with @testing-library/react and @testing-library/user-event , fixing a bug where tests would hang indefinitely when using user.click or similar interactions. Two issues were resolved: Fake timer detection — Bun now sets setTimeout.clock = true when fake timers are enabled, which @testing-library/react checks to determine whether to call jest.advanceTimersByTime when draining the microtask queue. Immediate timer handling — advanceTimersByTime 0 now correctly fires setTimeout fn, 0 callbacks. Per the HTML spec, setTimeout fn, 0 is internally scheduled with a 1ms delay, but Jest and testing-library expect advanceTimersByTime 0 to fire these "immediate" timers. js import { jest } from "bun:test"; import { render } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; it "works with fake timers", async = { jest.useFakeTimers ; const { getByRole } = render