Qu'est-ce que le format de fichier LOCKB ?
Un fichier .lockb est le fichier de verrouillage binaire créé par Bun, le gestionnaire de paquets et moteur d'exécution JavaScript et TypeScript d'Oven. Il est presque toujours nommé bun.lockb et se trouve à la racine d'un projet. Bun l'écrit lorsque vous lancez bun install, enregistrant le graphe complet des dépendances résolues : chaque paquet, sa version exacte, ses métadonnées, ses sous-dépendances et ses hachages d'intégrité. Le fait de figer tout cela permet à chaque membre de l'équipe et aux tâches de CI d'installer le même arbre.
Oven a conçu ce format en binaire pour la rapidité. Il stocke les données dans des tableaux linéaires, fait référence aux paquets par index ou par un hachage du nom du paquet, et déduplique les chaînes de caractères longues. Le fichier s'ouvre avec l'en-tête ASCII bun-lockfile-format-v0. L'inconvénient est qu'un fichier de verrouillage binaire est difficile à réviser et n'apparaît pas dans les diffs Git, c'est pourquoi Bun v1.1.39 a ajouté un fichier de verrouillage textuel et Bun v1.2 a fait de bun.lock le standard par défaut pour les nouveaux projets. Les fichiers bun.lockb existants fonctionnent toujours.
Sécurité et sûreté
RISQUE : 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.
Détails du format
en brefProgrammes qui ouvrent les fichiers LOCKB
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. Détails techniques
spécifications approfondies| 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 |
| Publié | 2022 |
| Dernière version | bun-lockfile-format-v0 |
| Spécification | github.com |
Conversions LOCKB
Q&R de la communauté
posées par les utilisateursPas encore de questions - soyez le premier à poser une question sur les fichiers LOCKB.
Foire aux questions
Comment ouvrir un fichier bun.lockb ?
bun bun.lockb. Bun affiche le fichier de verrouillage sous forme de texte lisible de style yarn.lock. Vous devez avoir Bun installé pour cela.Pourquoi bun.lockb est-il binaire au lieu de texte ?
Dois-je commiter bun.lockb dans Git ?
Comment convertir bun.lockb vers le nouveau bun.lock ?
bun install --save-text-lockfile --frozen-lockfile --lockfile-only, puis supprimez l'ancien bun.lockb. Bun v1.2 utilise le fichier texte bun.lock par défaut pour les nouveaux projets.Puis-je modifier un fichier bun.lockb à la main ?
package.json et lancez bun install pour régénérer le fichier de verrouillage. Modifier le binaire directement le corrompra.