Why convert LOCKB to JSON?
bun.lockb is Bun's binary lockfile that pins exact dependency versions and integrity hashes; developers want .json so they can inspect, diff, or feed the resolution data into tooling that cannot read the opaque binary format.
How to convert LOCKB to JSON
@hyrious/bun.lockb OPEN-SOURCE
Install with npm i @hyrious/bun.lockb, then run parse(fs.readFileSync('bun.lockb')) and JSON.stringify the result to get JSON. An online demo also exists at hyrious.me/tool/bun.lockb.
Bun text lockfile (bun.lock) FREE
On Bun 1.2+, run bun install --save-text-lockfile --frozen-lockfile --lockfile-only to produce bun.lock, which is JSONC and can be read as JSON after stripping comments.
bun bun.lockb (print) FREE
Run bun bun.lockb to print the lockfile contents to the console in a human-readable form you can capture and reshape into JSON.
About these formats
A .lockb file is Bun's binary install lockfile, almost always named bun.lockb. Bun writes it when you run bun install to pin the exact versions and integrity hashes of every dependency so…
Open .LOCKB details →A JSON file is a plain-text data file in JavaScript Object Notation format, used by web APIs, app configurations, and data exports. Any text editor opens it - Notepad on Windows, TextEdit…
Open .JSON details →Quality & what to watch
- The output is dependency-resolution data only (package names, versions, hashes) - it is not a package.json and cannot be installed from directly.
@hyrious/bun.lockb's object shape mirrors Bun's internal structure, not any standard schema, so field names may differ from what your tooling expects.- Binary-format details can change between Bun versions, so a parser built for one version may misread a lockfile written by another.
Frequently asked questions
Is bun.lockb human-readable?
@hyrious/bun.lockb or the text bun.lock to read it.Do I need Bun installed to convert it?
@hyrious/bun.lockb, which runs under Node. You do need Bun 1.2+ for the --save-text-lockfile route.Will the JSON let me reinstall my dependencies?
package.json plus a real lockfile.