---
title: "Bun v0.6.10"
description: "Bun v0.6.10 rewrites CommonJS module loading for better Node.js compatibility."
url: "https://swe.quest/articles/bun-v0-6-10-c9f67c1760f76c0a"
canonical: "https://bun.com/blog/bun-v0.6.10"
source: "Bun"
published: "2023-06-26"
difficulty: "medium"
kind: "Release"
reading_minutes: 8
tags: ["javascript","runtimes","testing","build-systems"]
---

# Bun v0.6.10

A post on [Bun](https://swe.quest/sources/bun.md), published 2023-06-26, 8 min read, Release. Original: [https://bun.com/blog/bun-v0.6.10](https://bun.com/blog/bun-v0.6.10)

## Summary

Bun v0.6.10 rewrites CommonJS module loading for better Node.js compatibility. That gets webpack working and adds \`require.main\`, \`process.mainModule\`, and runtime support for the \`\_\_esModule\` annotation, which preserves default exports when CJS output from bundlers is re-imported as ESM. That behaviour is disabled when no annotation is present or the package type is "module". The release also adds \`bun test\` matchers (resolves/rejects, toBeArray, toBeTypeOf) and \`spyOn()\`, \`fs.watch()\`, \`fs.readv\`/\`writev\`, and more of the V8 stack trace API. It fixes \`.env\` parsing and a latin1 truncation bug in the WebSocket client, and adds \`bun install --exact\`, \`--frozen-lockfile\`, and a \`trustedDependencies\` allow-list for lifecycle scripts.

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)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)

## Prerequisites

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

## Keywords

Bun, CommonJS, \_\_esModule, bun test, bun install, webpack, Node.js

## Related posts

- [Bun v0.6.5](https://swe.quest/articles/bun-v0-6-5-84c0b0fc152a661a.md): Bun · 2023-05-29 · Medium · 4 min read · JavaScript, Runtimes & VMs, Build systems
  Bun reimplements CommonJS as native runtime support instead of transpiler-only wrapping.
- [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 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.
- [Bun v0.1.11](https://swe.quest/articles/bun-v0-1-11-608f71de932fd530.md): Bun · 2022-09-07 · Medium · 4 min read · JavaScript, Runtimes & VMs
  Bun v0.1.11 adds a runtime plugin API, loosely modeled on esbuild's, that lets code import file types Bun has no built-in loader for (such as .svelte, .vue, .yaml, .mdx) and dynamically generate ESM/CJS modules, with examples for MDX and YAML loaders.
- [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.

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)
