---
title: "Bun's new text-based lockfile"
description: "Bun v1.1.39 introduces bun.lock, a JSONC text lockfile enabled via `bun install --save-text-lockfile`, replacing the hard-to-review binary bun.lockb and planned as the default in Bun v1.2."
url: "https://swe.quest/articles/bun-s-new-text-based-lockfile-e3afd1bb6d635a28"
canonical: "https://bun.com/blog/bun-lock-text-lockfile"
source: "Bun"
published: "2024-12-17"
difficulty: "medium"
kind: "Release"
reading_minutes: 5
tags: ["build-systems","javascript","performance","zig"]
---

# Bun's new text-based lockfile

A post on [Bun](https://swe.quest/sources/bun.md), published 2024-12-17, 5 min read, Release. Original: [https://bun.com/blog/bun-lock-text-lockfile](https://bun.com/blog/bun-lock-text-lockfile)

## Summary

Bun v1.1.39 introduces bun.lock, a JSONC text lockfile enabled via \`bun install --save-text-lockfile\`, replacing the hard-to-review binary bun.lockb and planned as the default in Bun v1.2. Existing bun.lockb or package-lock.json files are migrated with resolutions preserved, and GitHub diffs, VS Code highlighting and tools like Dependabot can now read the lockfile. Cached no-op installs with the text lockfile are 30% faster than v1.1.38's binary path, because the speed comes from structure-of-arrays layouts with indices instead of pointers, an 8-byte small string optimization in Zig, and careful use of syscalls like clonefile and memfd\_create, not from the binary format.

Written by swe.quest, not by the author.

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

## Topics

- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Zig](https://swe.quest/tags/zig.md) (Languages)

## Prerequisites

- npm lockfiles
- basic memory layout concepts

## Keywords

Bun, bun install, bun.lock, bun.lockb, JSONC, Dependabot, Zig

## Related posts

- [Bun v1.1.39](https://swe.quest/articles/bun-v1-1-39-87acf329d791d87e.md): Bun · 2024-12-17 · Medium · 9 min read · JavaScript, Runtimes & VMs, Build systems, Testing, Memory management
  Bun v1.1.39 introduces bun.lock, a human-readable text lockfile that improves git diffs and works with tools like Dependabot and Renovate, and makes cached bun install 30% faster.
- [Bun v1.1.40](https://swe.quest/articles/bun-v1-1-40-9a3067ef2dfd320e.md): Bun · 2024-12-18 · Medium · 2 min read · JavaScript, Runtimes & VMs, Build systems
  Bun v1.1.40 fixes 14 bugs and adds an \`install.saveTextLockfile\` option in bunfig.toml so the text-based \`bun.lock\` format can be the default ahead of Bun v1.2.
- [Bun v1.3.2](https://swe.quest/articles/bun-v1-3-2-22771baae9f86920.md): Bun · 2025-11-08 · Medium · 12 min read · JavaScript, Runtimes & VMs, Build systems, Testing
  Bun 1.3.2 restores hoisted installs as the default for existing workspaces and adds a lockfile configVersion field so future default changes don't break existing projects.
- [Bun v1.1.16](https://swe.quest/articles/bun-v1-1-16-73af18d20e38e0ab.md): Bun · 2024-06-23 · Medium · 6 min read · JavaScript, Runtimes & VMs, Testing, Build systems
  Bun v1.1.16 fixes 41 bugs and adds lcov output for \`bun test --coverage\`, configurable in bunfig.toml.
- [Bun v1.1.30](https://swe.quest/articles/bun-v1-1-30-4f8e7c9af8830c50.md): Bun · 2024-10-08 · Medium · 10 min read · JavaScript, Build systems, CSS, Runtimes & VMs, Developer tools
  Bun v1.1.30 adds an experimental CSS parser and bundler, a LightningCSS port rewritten from Rust to Zig.

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)
