{"versions":{"0.1.0":{"name":"@publint/pack","version":"0.1.0","description":"Utilities for packing and unpacking npm packages","type":"module","author":{"name":"Bjorn Lu"},"license":"MIT","exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"engines":{"node":">=18"},"funding":"https://bjornlu.com/sponsor","repository":{"type":"git","url":"git+https://github.com/bluwy/publint.git","directory":"packages/pack"},"bugs":{"url":"https://github.com/bluwy/publint/issues"},"keywords":["utilities","pack","unpack","npm"],"devDependencies":{"fs-fixture":"^2.6.0","vitest":"^3.0.0-beta.3"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_id":"@publint/pack@0.1.0","homepage":"https://github.com/bluwy/publint#readme","_integrity":"sha512-NvV5jPAQIMCoHvaJ0ZhfouBJ2woFYYf+o6B7dCHGh/tLKSPVoxhjffi35xPuMHgOv65aTOKUzML5XwQF9EkDAA==","_resolved":"/tmp/f28fe7f0893914b3c6cb9e1d5457ac7a/publint-pack-0.1.0.tgz","_from":"file:publint-pack-0.1.0.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-NvV5jPAQIMCoHvaJ0ZhfouBJ2woFYYf+o6B7dCHGh/tLKSPVoxhjffi35xPuMHgOv65aTOKUzML5XwQF9EkDAA==","shasum":"0cbdfe05f7a930b8eab35e5c228b9eb726cef9c8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@publint/pack/-/pack-0.1.0.tgz","fileCount":14,"unpackedSize":17356,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwjrp/dxqM0fFj/iNuybL4ixBEbHRG8R/VjJIs8FPK9AiBRD8UiRVR4UhNkr7tYJ8lnkybhG+re07bpFEx6psCWwg=="}],"size":5833},"_npmUser":{"name":"anonymous","email":"bjornlu.dev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.0_1736172641822_0.4548597857176153"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-06T14:10:42.028Z","publish_time":1736172642028,"_source_registry_name":"default","contributors":[]},"0.1.1":{"name":"@publint/pack","version":"0.1.1","description":"Utilities for packing and unpacking npm packages","type":"module","author":{"name":"Bjorn Lu"},"license":"MIT","exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"engines":{"node":">=18"},"funding":"https://bjornlu.com/sponsor","repository":{"type":"git","url":"git+https://github.com/publint/publint.git","directory":"packages/pack"},"bugs":{"url":"https://github.com/publint/publint/issues"},"keywords":["utilities","pack","unpack","npm"],"devDependencies":{"fs-fixture":"^2.6.0","vitest":"^3.0.0-beta.4"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_id":"@publint/pack@0.1.1","homepage":"https://github.com/publint/publint#readme","_integrity":"sha512-TvCl79Y8v18ZhFGd5mjO1kYPovSBq3+4LVCi5Nfl1JI8fS8i8kXbgQFGwBJRXczim8GlW8c2LMBKTtExYXOy/A==","_resolved":"/tmp/ad1faa8507b80de008b529b10bc11e74/publint-pack-0.1.1.tgz","_from":"file:publint-pack-0.1.1.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-TvCl79Y8v18ZhFGd5mjO1kYPovSBq3+4LVCi5Nfl1JI8fS8i8kXbgQFGwBJRXczim8GlW8c2LMBKTtExYXOy/A==","shasum":"886f19d46dcc7004c36c6f7b11b0af502407dd42","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@publint/pack/-/pack-0.1.1.tgz","fileCount":14,"unpackedSize":19420,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwzDnh1IP3/bM5+SdK0vFn4Na7GpbWTeJwjfJI2k8/sAiEAzywl4ezrf7wLBsWwAylbg4jjLua50C2wK5bpke3Gg8g="}],"size":6389},"_npmUser":{"name":"anonymous","email":"bjornlu.dev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.1_1736779210916_0.6317030645060506"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-13T14:40:11.109Z","publish_time":1736779211109,"_source_registry_name":"default","contributors":[]},"0.1.2":{"name":"@publint/pack","version":"0.1.2","description":"Utilities for packing and unpacking npm packages","type":"module","author":{"name":"Bjorn Lu"},"license":"MIT","exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"engines":{"node":">=18"},"funding":"https://bjornlu.com/sponsor","repository":{"type":"git","url":"git+https://github.com/publint/publint.git","directory":"packages/pack"},"bugs":{"url":"https://github.com/publint/publint/issues"},"keywords":["utilities","pack","unpack","npm"],"devDependencies":{"fs-fixture":"^2.7.1","vitest":"^3.0.6"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_id":"@publint/pack@0.1.2","homepage":"https://github.com/publint/publint#readme","_integrity":"sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==","_resolved":"/tmp/1d1bb18747560b64d1cc9aa4f3842b3c/publint-pack-0.1.2.tgz","_from":"file:publint-pack-0.1.2.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==","shasum":"1b9a9567423262093e4a73e77697b65bf622f8c9","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@publint/pack/-/pack-0.1.2.tgz","fileCount":14,"unpackedSize":19832,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXIX2xwwCiNv3CT+9Y6jPagy8+a4bz9xAYz5atDnMDnwIhANM0qNgfu2GTSR6T5ihe7VbEbjyjlqIz5AmwtccLlQk3"}],"size":6530},"_npmUser":{"name":"anonymous","email":"bjornlu.dev@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.2_1741015428399_0.7578201744152109"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-03T15:23:48.593Z","publish_time":1741015428593,"_source_registry_name":"default","contributors":[]},"0.1.3":{"name":"@publint/pack","version":"0.1.3","description":"Utilities for packing and unpacking npm packages","type":"module","author":{"name":"Bjorn Lu"},"license":"MIT","exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"engines":{"node":">=18"},"funding":"https://bjornlu.com/sponsor","repository":{"type":"git","url":"git+https://github.com/publint/publint.git","directory":"packages/pack"},"bugs":{"url":"https://github.com/publint/publint/issues"},"keywords":["utilities","pack","unpack","npm"],"devDependencies":{"fs-fixture":"^2.11.0","vitest":"^4.0.17"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_id":"@publint/pack@0.1.3","homepage":"https://github.com/publint/publint#readme","_integrity":"sha512-dHDWeutAerz+Z2wFYAce7Y51vd4rbLBfUh0BNnyul4xKoVsPUVJBrOAFsJvtvYBwGFJSqKsxyyHf/7evZ8+Q5Q==","_resolved":"/tmp/5f487c16ae60341a5c259d6bae322140/publint-pack-0.1.3.tgz","_from":"file:publint-pack-0.1.3.tgz","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-dHDWeutAerz+Z2wFYAce7Y51vd4rbLBfUh0BNnyul4xKoVsPUVJBrOAFsJvtvYBwGFJSqKsxyyHf/7evZ8+Q5Q==","shasum":"624ee3963e43596e8442c7b86cdfe0b1faf6e674","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@publint/pack/-/pack-0.1.3.tgz","fileCount":15,"unpackedSize":22571,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCSvPmbqBO9ak/5tAwC9BttB3VPsinwP2KcY+ZQqvgzoQIgcotB9UAWluq2AeUgi7Iuvp7aheQZzS/ncByalZ98FgQ="}],"size":7083},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"directories":{},"maintainers":[{"name":"anonymous","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.3_1769010654399_0.1181455580091475"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-21T15:50:54.551Z","publish_time":1769010654551,"_source_registry_name":"default","contributors":[]},"0.1.4":{"name":"@publint/pack","version":"0.1.4","description":"Utilities for packing and unpacking npm packages","type":"module","author":{"name":"Bjorn Lu"},"license":"MIT","exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"engines":{"node":">=18"},"funding":"https://bjornlu.com/sponsor","repository":{"type":"git","url":"git+https://github.com/publint/publint.git","directory":"packages/pack"},"bugs":{"url":"https://github.com/publint/publint/issues"},"keywords":["utilities","pack","unpack","npm"],"devDependencies":{"fs-fixture":"^2.11.0","vitest":"^4.0.18"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_id":"@publint/pack@0.1.4","homepage":"https://github.com/publint/publint#readme","_integrity":"sha512-HDVTWq3H0uTXiU0eeSQntcVUTPP3GamzeXI41+x7uU9J65JgWQh3qWZHblR1i0npXfFtF+mxBiU2nJH8znxWnQ==","_resolved":"/tmp/151bcc14673afdcca358fdd05fc99096/publint-pack-0.1.4.tgz","_from":"file:publint-pack-0.1.4.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-HDVTWq3H0uTXiU0eeSQntcVUTPP3GamzeXI41+x7uU9J65JgWQh3qWZHblR1i0npXfFtF+mxBiU2nJH8znxWnQ==","shasum":"866a82a1a8ab52329ae08baec6f3969ed99a30bf","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@publint/pack/-/pack-0.1.4.tgz","fileCount":15,"unpackedSize":23015,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICgBsldfc63lkNAJI+AAttK7d8InWWwtmFXOIOqF/BhRAiBdSzuUzxBS0DX3F1BhZdfMLSl8RTR/qVerQJc4RUPO7Q=="}],"size":7132},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"directories":{},"maintainers":[{"name":"anonymous","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.4_1770311222249_0.6763362531967179"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-05T17:07:02.454Z","publish_time":1770311222454,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.1.4"},"name":"@publint/pack","time":{"created":"2025-01-06T14:12:17.666Z","modified":"2026-02-05T17:07:21.439Z","0.1.0":"2025-01-06T14:10:42.028Z","0.1.1":"2025-01-13T14:40:11.109Z","0.1.2":"2025-03-03T15:23:48.593Z","0.1.3":"2026-01-21T15:50:54.551Z","0.1.4":"2026-02-05T17:07:02.454Z"},"readme":"# @publint/pack\n\nZero-dependencies utilities for packing and unpacking npm packages. Supports:\n\n<!-- The list below should sync with the docs at /docs/index.md -->\n\n- npm (v9, v10, v11)\n- yarn (v3, v4)\n- pnpm (v8, v9, v10)\n- bun\n\nOlder versions of these package managers may still work, but they're not officially tested. Yarn 1 is also explicitly not supported.\n\n## API\n\nNOTE: All `pack*` APIs support passing `opts.packageManager` to specify the package manager to use for packing, and `opts.ignoreScripts` to skip running lifecycle scripts.\n\n### `pack()`\n\n- **Type**: `(dir: string, opts?: PackOptions): Promise<string>`\n\nPacks the given directory and returns the packed tarball path. Pass `opts.destination` to change the output directory of the tarball.\n\n```js\nimport { pack } from '@publint/pack'\n\nconst tarballPath = await pack(process.cwd())\nconsole.log(tarballPath)\n// => '/Users/bluwy/project/project-1.0.0.tgz'\n```\n\n### `packAsList()`\n\n- **Type**: `(dir: string, opts?: PackAsListOptions): Promise<string>`\n\nPacks the given directory and returns a list of relative file paths that were packed.\n\nThe relative file paths should be resolved via `getPackDirectory()` if a different packed directory was used.\n\n> [!NOTE]\n> Compared to [`npm-packlist`](https://github.com/npm/npm-packlist), this API works at a higher level by invoking the package manager `pack` command to retrieve the list of files packed. While `npm-packlist` is abstracted away from `npm` to expose a more direct API, unfortunately not all package managers pack files the same way, e.g. the patterns in `\"files\"` may be interpreted differently. Plus, since `npm-packlist` v7, it requires `@npmcli/arborist` to be used together, which is a much larger dependency to include altogether.\n>\n> This package provides an alternative API that works across package managers with a much smaller package size. However, as it executes commands in a child process, it's usually slightly slower (around 200-500ms minimum depending on package manager used and the project size).\n\n```js\nimport { packAsList } from '@publint/pack'\n\nconst files = await packAsList(process.cwd())\nconsole.log(files)\n// => ['src/index.js', 'package.json']\n```\n\n### `packAsJson()`\n\n- **Type**: `(dir: string, opts?: PackAsJsonOptions): Promise<string>`\n\nPacks the given directory with the `--json` flag and returns its stdout as JSON. You can run the `<pm> pack --json` command manually to inspect the output shape.\n\nRelative file paths in the output can be resolved via `getPackDirectory()` if a different packed directory was used.\n\n> [!NOTE]\n> Does not work in pnpm <9.14.1 and bun as they don't support the `--json` flag.\n\n```js\nimport { packAsJson } from '@publint/pack'\n\nconst json = await packAsJson(process.cwd())\nconsole.log(json)\n// => [{ \"id\": \"project@1.0.0\", ...  }]\n```\n\n### `getPackDirectory()`\n\n- **Type**: `(dir: string, packageManager?: PackageManager): Promise<string>`\n\nGets the directory that is being packed by the package manager. Usually this is the same as the input `dir`, but some package managers (like pnpm) allows changing the packed directory via the `publishConfig.directory` field in `package.json`.\n\n```js\nimport { getPackDirectory } from '@publint/pack'\nconst packDir = await getPackDirectory(process.cwd(), 'pnpm')\nconsole.log(packDir)\n// => '<cwd>/dist' (if \"publishConfig.directory\" is set to \"dist\" in package.json)\n```\n\n### `unpack()`\n\n- **Type**: `(tarball: ArrayBuffer | ReadableStream<Uint8Array>): Promise<UnpackResult>`\n\nUnpacks the given tarball buffer (gzip-decompress + untar). It accepts either a `ReadableStream`, `ArrayBuffer`, or `Uint8Array`. In Node.js,`ArrayBuffer` and `Uint8Array` are faster, while in browsers, `ReadableStream` is faster.\n\nFor example, when using `fetch()` in Node.js, use `response.arrayBuffer()` or `response.bytes()`, while in browsers, use `response.body` directly.\n\nIt returns an object with `files`, which is the list of unpacked files, and `rootDir`, which is the shared root directory among all files. (See JSDoc for examples)\n\n```js\nimport { unpack } from '@publint/pack'\n\nconst response = await fetch('https://registry.npmjs.org/mylib/-/mylib-1.0.0.tgz')\nif (!response.body) throw new Error('Failed to fetch tarball')\n\nconst result = await unpack(response.body)\nconsole.log(result)\n// => { files: [...], rootDir: 'package' }\n```\n\n## License\n\nMIT","users":{}}