Was ist das LOCKB-Dateiformat?
Eine .lockb-Datei ist das binäre Lockfile, das von Bun erstellt wird, dem JavaScript- und TypeScript-Paketmanager und der Runtime von Oven. Sie heißt fast immer bun.lockb und befindet sich im Stammverzeichnis eines Projekts. Bun schreibt sie beim Ausführen von bun install und zeichnet den vollständigen aufgelösten Abhängigkeitsgraphen auf: jedes Paket, seine exakte Version, seine Metadaten, seine Unterabhängigkeiten und Integritäts-Hashes. Das Festschreiben all dieser Daten ermöglicht es jedem Teammitglied und jedem CI-Job, denselben Baum zu installieren.
Oven hat das Format aus Geschwindigkeitsgründen als Binärdatei entwickelt. Es speichert Daten in linearen Arrays, referenziert Pakete über einen Index oder einen Hash des Paketnamens und dedupliziert lange Zeichenfolgen. Die Datei beginnt mit dem ASCII-Header bun-lockfile-format-v0. Der Nachteil ist, dass eine binäre Lockfile schwer zu überprüfen ist und nicht in Git-Diffs angezeigt wird, weshalb Bun v1.1.39 eine Text-Lockfile hinzugefügt hat und Bun v1.2 bun.lock zum Standard für neue Projekte gemacht hat. Bestehende bun.lockb-Dateien funktionieren weiterhin.
Sicherheit
RISIKO: LOWA bun.lockb file is generated data, not an executable, so opening or committing it is safe. Bun can 'run' the file only in the sense that bun ./bun.lockb prints its contents; it does not execute arbitrary code from the file. The only real caution is supply-chain trust: the lockfile pins specific package versions and their sources, so review dependency changes as you would any lockfile update. Never edit it by hand, since a corrupted binary lockfile will fail to parse.
Formatdetails
kurz gefasstProgramme zum Öffnen von LOCKB-Dateien
bun bun.lockb in the project directory to print the lockfile as readable yarn.lock-style text, or bun install to use it. bun.lockb. bun.lockb and print its contents without installing Bun. bun bun.lockb to print the lockfile as readable text, or bun install to reinstall from it. bun.lockb as text inside the editor. bun.lockb contents in Node or the browser without Bun installed. bun bun.lockb for a readable text dump, or bun install to install dependencies from it. bun.lockb as readable text. git config diff.lockb.textconv bun so git diff shows bun.lockb changes as readable text. Technische Details
technische Spezifikation| Encoding | Binary (serialized struct-of-arrays memory dump) |
| Byte order | Little-endian (native to the machine that wrote it) |
| Container | Flat custom binary format, not a standard container |
| Compression | None; long strings over 88 characters are deduplicated to save space |
| Typical size | A few KB to a few hundred KB depending on dependency count |
| Structure | A header/magic string followed by linear arrays: package list, string buffer, dependency slices, resolutions, and hoisting trees. Packages are referenced by an auto-incrementing index or a hash of the package name rather than by repeated name strings. |
| Integrity | Stores npm-style integrity hashes for each resolved package; the format itself is version-tagged via the header string |
| Platforms | Windows, macOS, Linux |
| Notes | Designed for fast reads and memory mapping. It is not human-readable and does not render in Git or GitHub diffs without a textconv helper. Superseded as the default by the text-based bun.lock (JSONC) in Bun v1.2, but still supported. |
| Human Readable | No |
| Veröffentlicht | 2022 |
| Neueste Version | bun-lockfile-format-v0 |
| Spezifikation | github.com |
LOCKB-Konvertierungen
Community Q&A
von Nutzern gefragtNoch keine Fragen - stellen Sie die erste Frage zu LOCKB-Dateien.
Häufig gestellte Fragen
Wie öffne ich eine bun.lockb-Datei?
bun bun.lockb aus. Bun gibt die Lockfile als lesbaren Text im yarn.lock-Stil aus. Dafür muss Bun installiert sein.Warum ist bun.lockb binär statt Text?
Sollte ich bun.lockb in Git einchecken?
Wie konvertiere ich bun.lockb in das neue bun.lock?
bun install --save-text-lockfile --frozen-lockfile --lockfile-only aus und löschen Sie dann die alte bun.lockb. Bun v1.2 verwendet standardmäßig die textbasierte bun.lock für neue Projekte.Kann ich eine bun.lockb-Datei von Hand bearbeiten?
package.json und führen Sie bun install aus, um die Lockfile neu zu generieren. Das direkte Bearbeiten der Binärdatei führt zu Fehlern.