O que é o formato de ficheiro LOCKB?
Um arquivo .lockb é o arquivo de bloqueio binário criado pelo Bun, o gerenciador de pacotes e runtime de JavaScript e TypeScript da Oven. Ele é quase sempre nomeado como bun.lockb e reside na raiz de um projeto. O Bun o grava quando você executa bun install, registrando o gráfico de dependências resolvido completo: cada pacote, sua versão exata, seus metadados, suas subdependências e hashes de integridade. Fixar tudo isso permite que cada colega de equipe e tarefa de CI instale a mesma árvore.
A Oven construiu o formato como binário para fins de velocidade. Ele armazena dados em arrays lineares, refere-se a pacotes por índice ou por um hash do nome do pacote e remove a duplicidade de strings longas. O arquivo começa com o cabeçalho ASCII bun-lockfile-format-v0. A desvantagem é que um arquivo de bloqueio binário é difícil de revisar e não aparece nos diffs do Git, razão pela qual o Bun v1.1.39 adicionou um lockfile de texto e o Bun v1.2 tornou o bun.lock o padrão para novos projetos. Arquivos bun.lockb existentes ainda funcionam.
Segurança e proteção
RISCO: 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.
Detalhes do formato
em resumoProgramas que abrem arquivos 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. Detalhes técnicos
especificação 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 |
| Lançado | 2022 |
| Versão mais recente | bun-lockfile-format-v0 |
| Especificação | github.com |
Conversões de LOCKB
Perguntas e Respostas da Comunidade
perguntado por usuáriosAinda não há perguntas - seja o primeiro a perguntar sobre arquivos LOCKB.
Perguntas frequentes
Como faço para abrir um arquivo bun.lockb?
bun bun.lockb. O Bun imprime o lockfile como um texto legível no estilo yarn.lock. Você precisa do Bun instalado para isso.Por que o bun.lockb é binário em vez de texto?
Devo enviar o bun.lockb para o Git?
Como converto o bun.lockb para o novo bun.lock?
bun install --save-text-lockfile --frozen-lockfile --lockfile-only e depois exclua o antigo bun.lockb. O Bun v1.2 usa o bun.lock baseado em texto por padrão para novos projetos.Posso editar um arquivo bun.lockb manualmente?
package.json e execute bun install para regenerar o arquivo. Editar o binário diretamente irá corrompê-lo.