{"_id":"@beamhop/registry","_rev":"5-b4af8987c8e1cd72dcdc6fdf81bb6256","name":"@beamhop/registry","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@beamhop/registry","version":"0.1.0","license":"MIT","_id":"@beamhop/registry@0.1.0","maintainers":[{"name":"kucukkanat","email":"htolgasahin@gmail.com"}],"homepage":"https://beamhop.github.io/beambox/","bugs":"https://github.com/beamhop/beambox/issues","dist":{"shasum":"3c73922c67247a014a968907fa41c4a5f1adb1ce","tarball":"https://registry.npmjs.org/@beamhop/registry/-/registry-0.1.0.tgz","fileCount":11,"integrity":"sha512-1P+gfycodqtPjKn+Cu/2dzyaPqsWYk8ToaMtu0iUTSFWRB/bzoCsDqdz8teoiUi9XU0mp1IACys/R4n1SKeFSA==","signatures":[{"sig":"MEUCIQD7bk0ZqnCukQBqbxoSORr0qGAvxQLJUGXHgjfei9ejbgIgeGw0PWqGB+11ySt3CW10k9n8nIWyBsTZDa/r7pYjv0c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68651},"type":"module","shasum":"3c73922c67247a014a968907fa41c4a5f1adb1ce","engines":{"node":">=20"},"exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"scripts":{"build":"tsdown"},"_npmUser":{"name":"kucukkanat","email":"htolgasahin@gmail.com"},"_integrity":"sha512-1P+gfycodqtPjKn+Cu/2dzyaPqsWYk8ToaMtu0iUTSFWRB/bzoCsDqdz8teoiUi9XU0mp1IACys/R4n1SKeFSA==","deprecated":"Broken on Node: RUN builds throw 'Bun is not defined' from the layer cache. Use 0.1.1 or later.","repository":{"url":"git+https://github.com/beamhop/beambox.git","type":"git","directory":"packages/registry"},"_npmVersion":"10.8.3","description":"Pure-TypeScript OCI Distribution v2 client — pull and push images without a Docker daemon.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.14","@beamhop/oci":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/registry_0.1.0_1786140830651_0.5633653940013856","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@beamhop/registry","version":"0.1.1","license":"MIT","_id":"@beamhop/registry@0.1.1","maintainers":[{"name":"kucukkanat","email":"htolgasahin@gmail.com"}],"homepage":"https://beamhop.github.io/beambox/","bugs":"https://github.com/beamhop/beambox/issues","dist":{"shasum":"365fd8a8417c00656a2849e0e1123f85d5febdef","tarball":"https://registry.npmjs.org/@beamhop/registry/-/registry-0.1.1.tgz","fileCount":11,"integrity":"sha512-J/7q4R/g1322mWadcStkCxRJgw1HrcTY0EoOVYXF8guftBJNAKia2vennbJbQWPyQoVBIDqux8ZUGVltsKy3uQ==","signatures":[{"sig":"MEUCICYEhwJMEFici9wITBzksbZpYQ+uG7Dw/2SPeP6D03SWAiEAxe0opGDnYzVMTqkFnEiqiyt4drjrc0hw+jqmV2J2F9M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68651},"type":"module","shasum":"365fd8a8417c00656a2849e0e1123f85d5febdef","engines":{"node":">=20"},"exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"scripts":{"build":"tsdown"},"_npmUser":{"name":"kucukkanat","email":"htolgasahin@gmail.com"},"_integrity":"sha512-J/7q4R/g1322mWadcStkCxRJgw1HrcTY0EoOVYXF8guftBJNAKia2vennbJbQWPyQoVBIDqux8ZUGVltsKy3uQ==","repository":{"url":"git+https://github.com/beamhop/beambox.git","type":"git","directory":"packages/registry"},"_npmVersion":"10.8.3","description":"Pure-TypeScript OCI Distribution v2 client — pull and push images without a Docker daemon.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.14","@beamhop/oci":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/registry_0.1.1_1786141808693_0.18481197745408284","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Depends on the broken 0.1.0 packages; RUN builds fail on Node. Use 0.1.2 or later."},"0.1.2":{"name":"@beamhop/registry","version":"0.1.2","license":"MIT","_id":"@beamhop/registry@0.1.2","maintainers":[{"name":"kucukkanat","email":"htolgasahin@gmail.com"}],"homepage":"https://beamhop.github.io/beambox/","bugs":"https://github.com/beamhop/beambox/issues","dist":{"shasum":"c91c9b7d1899d0b4cb37aa93be64295b43c2c3ca","tarball":"https://registry.npmjs.org/@beamhop/registry/-/registry-0.1.2.tgz","fileCount":11,"integrity":"sha512-4H3NxGIHH/1aBLnP3S7NA91Pqmt1W7hwtuHASzUefIzMU3wj7YIWnOHD8IWdP6D5bo4KVxdDj6hrk41F2HqQ8g==","signatures":[{"sig":"MEUCIA24EDeJRiEuy2nE6NVPkfgjV36tdGGlxPwc0Ea4dYvwAiEAmLwZ5dsKyvMQFmkGlBYhCtheBmLOYWWzYVbnwXsdxqg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68651},"type":"module","shasum":"c91c9b7d1899d0b4cb37aa93be64295b43c2c3ca","engines":{"node":">=20"},"exports":{".":{"bun":"./src/index.ts","types":"./dist/index.d.mts","default":"./dist/index.mjs"}},"scripts":{"build":"tsdown"},"_npmUser":{"name":"kucukkanat","email":"htolgasahin@gmail.com"},"_integrity":"sha512-4H3NxGIHH/1aBLnP3S7NA91Pqmt1W7hwtuHASzUefIzMU3wj7YIWnOHD8IWdP6D5bo4KVxdDj6hrk41F2HqQ8g==","repository":{"url":"git+https://github.com/beamhop/beambox.git","type":"git","directory":"packages/registry"},"_npmVersion":"10.8.3","description":"Pure-TypeScript OCI Distribution v2 client — pull and push images without a Docker daemon.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.1.14","@beamhop/oci":"0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/registry_0.1.2_1786141959841_0.03210782787861732","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-08-07T22:13:50.500Z","modified":"2026-08-07T22:33:45.615Z","0.1.0":"2026-08-07T22:13:50.789Z","0.1.1":"2026-08-07T22:30:08.841Z","0.1.2":"2026-08-07T22:32:39.948Z"},"bugs":"https://github.com/beamhop/beambox/issues","license":"MIT","homepage":"https://beamhop.github.io/beambox/","repository":{"url":"git+https://github.com/beamhop/beambox.git","type":"git","directory":"packages/registry"},"description":"Pure-TypeScript OCI Distribution v2 client — pull and push images without a Docker daemon.","maintainers":[{"name":"kucukkanat","email":"htolgasahin@gmail.com"}],"readme":"# @beamhop/registry\n\nA pure-TypeScript OCI Distribution v2 client. Pull and push images from Docker Hub, GHCR,\nECR, GCR, or any conformant registry — with no Docker daemon involved.\n\n```bash\nbun add @beamhop/registry\n```\n\n## Pulling\n\n```ts\nimport { BlobStore, parseReference } from \"@beamhop/oci\"\nimport { hostPlatform, pullImage } from \"@beamhop/registry\"\n\nconst store = new BlobStore(\"./cache/blobs\")\n\nconst image = await pullImage(store, parseReference(\"alpine:3.20\"), {\n  platform: hostPlatform(),\n  onProgress: ({ index, total, cached }) =>\n    console.log(`layer ${index + 1}/${total} ${cached ? \"cached\" : \"downloaded\"}`),\n})\n\nconsole.log(image.config.config?.Cmd)   // [ \"/bin/sh\" ]\nconsole.log(image.layers.length)\n```\n\nMulti-platform references are resolved through their index, and BuildKit's SBOM and\nprovenance manifests are skipped rather than mistaken for images.\n\nEvery downloaded blob is verified against the digest that referenced it before it is\ncommitted, and layers already in the store are not downloaded again — which is what makes\na second build on the same base nearly free.\n\nDiff IDs are recomputed from the bytes rather than trusted from the config, so a\ndisagreement surfaces at pull time instead of producing an image that fails to unpack.\n\n## Pushing\n\n```ts\nimport { pushImage } from \"@beamhop/registry\"\n\nconst digest = await pushImage(image, parseReference(\"ghcr.io/me/app:v1\"), {\n  auth: { kind: \"basic\", username: \"me\", password: process.env.GITHUB_TOKEN ?? \"\" },\n  onProgress: (event) => console.log(event.what, event.skipped ? \"(already present)\" : \"uploaded\"),\n})\n```\n\nBlobs go up before the manifest that references them, as the spec requires, and blobs the\nregistry already holds are skipped after a cheap `HEAD` — so re-pushing an image whose base\nlayers are already there transfers only what changed.\n\n## Authentication\n\nCredentials are resolved in this order: explicit `auth`, then `~/.docker/config.json`.\nAnonymous pulls work without either — Docker Hub still issues a token, and the client\nhandles that challenge automatically.\n\n```ts\n// Explicit\n{ auth: { kind: \"basic\", username: \"deploy\", password: process.env.TOKEN ?? \"\" } }\n{ auth: { kind: \"bearer\", token: process.env.TOKEN ?? \"\" } }\n\n// Skip the Docker config entirely\n{ useDockerCredentials: false }\n```\n\nTokens are cached per scope, so pulling twenty layers from one repository costs one token\nexchange.\n\n## Local and internal registries\n\n```ts\n// Plain HTTP, e.g. a local `registry:2` on port 5050\nawait pullImage(store, parseReference(\"localhost:5050/app:v1\"), { insecure: true })\n\n// An internal CA\nawait pullImage(store, parseReference(\"registry.corp.io/team/app:v1\"), {\n  caCerts: \"/etc/ssl/corporate-ca.pem\",\n})\n```\n\n## Errors\n\n`RegistryAuthError` says whether credentials were even available. `PlatformNotFoundError`\nlists the platforms that *are* published. `ForeignLayerError` refuses non-distributable\nlayers rather than producing an image whose layers cannot be fetched. `RegistryRequestError`\ncarries the status and response body.\n\n```ts\nimport { PlatformNotFoundError } from \"@beamhop/registry\"\n\ntry {\n  await pullImage(store, parseReference(\"some/image\"), {\n    platform: { os: \"linux\", architecture: \"riscv64\" },\n  })\n} catch (error) {\n  if (error instanceof PlatformNotFoundError) console.log(error.available)\n  // [ \"linux/amd64\", \"linux/arm64\" ]\n}\n```\n\n## Lower-level access\n\n`RegistryClient` exposes the raw API when you need it — `getManifest`, `blobStream`,\n`blobExists`, `putBlob`, `putManifest` — with auth handled for you.\n\n```ts\nimport { RegistryClient } from \"@beamhop/registry\"\n\nconst client = new RegistryClient(\"ghcr.io\")\nconst { bytes, mediaType, digest } = await client.getManifest(\"me/app\", \"v1\")\n```\n","readmeFilename":"README.md"}