¿Qué es el formato de archivo LOCKB?
Un archivo .lockb es el archivo de bloqueo binario creado por Bun, el gestor de paquetes y entorno de ejecución de JavaScript y TypeScript de Oven. Casi siempre se llama bun.lockb y se ubica en la raíz de un proyecto. Bun lo escribe cuando ejecutas bun install, registrando el grafo de dependencias resuelto completo: cada paquete, su versión exacta, sus metadatos, sus subdependencias y los hashes de integridad. Fijar todo esto permite que cada compañero de equipo y trabajo de CI instale el mismo árbol.
Oven construyó el formato como binario por velocidad. Almacena datos en matrices lineales, se refiere a los paquetes por índice o por un hash del nombre del paquete, y deduplica cadenas largas. El archivo se abre con el encabezado ASCII bun-lockfile-format-v0. La desventaja es que un archivo de bloqueo binario es difícil de revisar y no aparece en los diffs de Git, razón por la cual Bun v1.1.39 añadió un archivo de bloqueo de texto y Bun v1.2 convirtió a bun.lock en el predeterminado para nuevos proyectos. Los archivos bun.lockb existentes siguen funcionando.
Seguridad y protección
RIESGO: 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.
Detalles del formato
en pocas palabrasProgramas que abren archivos 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. Detalles técnicos
especificación profunda| 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 |
| Lanzado | 2022 |
| Última versión | bun-lockfile-format-v0 |
| Especificación | github.com |
Conversiones de LOCKB
Preguntas y respuestas de la comunidad
preguntado por usuariosAún no hay preguntas; sea el primero en preguntar sobre los archivos LOCKB.
Preguntas frecuentes
¿Cómo abro un archivo bun.lockb?
bun bun.lockb. Bun imprime el archivo de bloqueo como texto legible estilo yarn.lock. Necesitas tener Bun instalado para esto.¿Por qué bun.lockb es binario en lugar de texto?
¿Debo incluir bun.lockb en Git?
¿Cómo convierto bun.lockb al nuevo bun.lock?
bun install --save-text-lockfile --frozen-lockfile --lockfile-only, luego elimina el antiguo bun.lockb. Bun v1.2 usa el bun.lock basado en texto por defecto para nuevos proyectos.¿Puedo editar un archivo bun.lockb a mano?
package.json y ejecuta bun install para regenerar el archivo de bloqueo. Editar el binario directamente lo corromperá.