---
title: "Bun v0.6.5"
description: "Bun reimplements CommonJS as native runtime support instead of transpiler-only wrapping."
url: "https://swe.quest/articles/bun-v0-6-5-84c0b0fc152a661a"
canonical: "https://bun.com/blog/bun-v0.6.5"
source: "Bun"
published: "2023-05-29"
difficulty: "medium"
kind: "Release"
reading_minutes: 4
tags: ["javascript","runtimes","build-systems"]
---

# Bun v0.6.5

A post on [Bun](https://swe.quest/sources/bun.md), published 2023-05-29, 4 min read, Release. Original: [https://bun.com/blog/bun-v0.6.5](https://bun.com/blog/bun-v0.6.5)

## Summary

Bun reimplements CommonJS as native runtime support instead of transpiler-only wrapping. Detected CJS modules are wrapped in a (module, exports, require) function, evaluated, and their exports appended as named ES Module exports, which fixes \`export \* from\`, sloppy-mode code and packages like Vue, Winston and viem. The release also improves CJS-to-ESM conversion in Bun.build(), adds $npm\_lifecycle\_event to bun run, and ignores SIGPIPE to stop crashes when streaming files to disconnected clients. It also fixes node:net createConnection argument parsing and a transpiler bug that turned Symbol\["for"\] into undefined.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Runtimes & VMs](https://swe.quest/tags/runtimes.md) (Compilers & runtimes)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)

## Prerequisites

- CommonJS vs ES Modules
- Node.js module resolution ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Bun, CommonJS, ES Modules, Bun.build, Bun.serve, SIGPIPE, node:net

## Related posts

- [Bun v0.6.10](https://swe.quest/articles/bun-v0-6-10-c9f67c1760f76c0a.md): Bun · 2023-06-26 · Medium · 8 min read · JavaScript, Runtimes & VMs, Testing, Build systems
  Bun v0.6.10 rewrites CommonJS module loading for better Node.js compatibility.
- [Bun v0.6.7](https://swe.quest/articles/bun-v0-6-7-7c277e48946bb12b.md): Bun · 2023-06-02 · Medium · 4 min read · JavaScript, Runtimes & VMs
  Bun v0.6.7 fixes Node.js compatibility bugs in Node-API, node:http, undici, WebSocket, node:net and CommonJS/ESM interop, which lets Prisma, Discord.js and Puppeteer run in Bun.
- [CommonJS is not going away](https://swe.quest/articles/commonjs-is-not-going-away-37cb3b514e9c598b.md): Bun · 2023-06-30 · Medium · 5 min read · JavaScript, Runtimes & VMs, Performance engineering
  CommonJS remains the dominant format on npm (about 74% of popular packages in late 2022), so Bun now implements it natively as of v0.6.5 instead of transpiling it to a synchronous ESM form.
- [Bun v1.1.41](https://swe.quest/articles/bun-v1-1-41-2cd6177e31a6ba8f.md): Bun · 2024-12-20 · Medium · 6 min read · JavaScript, Runtimes & VMs, Build systems
  Bun v1.1.41 fixes 12 bugs and improves node:vm compatibility so JSDOM (runScripts, runInContext) and happy-dom work more reliably. bun build --compile gains Windows-only --windows-icon and --windows-hide-console flags, Bun.build adds throw: true, and bun install supports --omit=dev|optional|peer plus include/exclude in .npmrc and bunfig.toml.
- [Bun v1.0.34](https://swe.quest/articles/bun-v1-0-34-71bd687b8a0e458e.md): Bun · 2024-03-22 · Medium · 6 min read · JavaScript, Runtimes & VMs, Build systems, Performance engineering
  Bun v1.0.34 makes cross-filesystem fs.cp and fs.copyFile about 50% faster on Linux by adding sendfile to its copy syscalls, which also speeds up bun install on Docker and WSL where renameat(2) across overlayfs or remote mounts isn't available.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
