{"_id":"@publint/pack","_rev":"8-ea2deee45f47623132f1b3edc145c904","name":"@publint/pack","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@publint/pack","version":"0.1.0","keywords":["utilities","pack","unpack","npm"],"author":{"name":"Bjorn Lu"},"license":"MIT","_id":"@publint/pack@0.1.0","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/bluwy/publint#readme","bugs":{"url":"https://github.com/bluwy/publint/issues"},"dist":{"shasum":"0cbdfe05f7a930b8eab35e5c228b9eb726cef9c8","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.0.tgz","fileCount":14,"integrity":"sha512-NvV5jPAQIMCoHvaJ0ZhfouBJ2woFYYf+o6B7dCHGh/tLKSPVoxhjffi35xPuMHgOv65aTOKUzML5XwQF9EkDAA==","signatures":[{"sig":"MEQCICwjrp/dxqM0fFj/iNuybL4ixBEbHRG8R/VjJIs8FPK9AiBRD8UiRVR4UhNkr7tYJ8lnkybhG+re07bpFEx6psCWwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":17356},"type":"module","_from":"file:publint-pack-0.1.0.tgz","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/tmp/f28fe7f0893914b3c6cb9e1d5457ac7a/publint-pack-0.1.0.tgz","_integrity":"sha512-NvV5jPAQIMCoHvaJ0ZhfouBJ2woFYYf+o6B7dCHGh/tLKSPVoxhjffi35xPuMHgOv65aTOKUzML5XwQF9EkDAA==","repository":{"url":"git+https://github.com/bluwy/publint.git","type":"git","directory":"packages/pack"},"_npmVersion":"10.9.0","description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0-beta.3","fs-fixture":"^2.6.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.0_1736172641822_0.4548597857176153","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@publint/pack","version":"0.1.1","keywords":["utilities","pack","unpack","npm"],"author":{"name":"Bjorn Lu"},"license":"MIT","_id":"@publint/pack@0.1.1","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/publint/publint#readme","bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"886f19d46dcc7004c36c6f7b11b0af502407dd42","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.1.tgz","fileCount":14,"integrity":"sha512-TvCl79Y8v18ZhFGd5mjO1kYPovSBq3+4LVCi5Nfl1JI8fS8i8kXbgQFGwBJRXczim8GlW8c2LMBKTtExYXOy/A==","signatures":[{"sig":"MEUCIGwzDnh1IP3/bM5+SdK0vFn4Na7GpbWTeJwjfJI2k8/sAiEAzywl4ezrf7wLBsWwAylbg4jjLua50C2wK5bpke3Gg8g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19420},"type":"module","_from":"file:publint-pack-0.1.1.tgz","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/tmp/ad1faa8507b80de008b529b10bc11e74/publint-pack-0.1.1.tgz","_integrity":"sha512-TvCl79Y8v18ZhFGd5mjO1kYPovSBq3+4LVCi5Nfl1JI8fS8i8kXbgQFGwBJRXczim8GlW8c2LMBKTtExYXOy/A==","repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"_npmVersion":"10.9.0","description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0-beta.4","fs-fixture":"^2.6.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.1_1736779210916_0.6317030645060506","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@publint/pack","version":"0.1.2","keywords":["utilities","pack","unpack","npm"],"author":{"name":"Bjorn Lu"},"license":"MIT","_id":"@publint/pack@0.1.2","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/publint/publint#readme","bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"1b9a9567423262093e4a73e77697b65bf622f8c9","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.2.tgz","fileCount":14,"integrity":"sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==","signatures":[{"sig":"MEYCIQCXIX2xwwCiNv3CT+9Y6jPagy8+a4bz9xAYz5atDnMDnwIhANM0qNgfu2GTSR6T5ihe7VbEbjyjlqIz5AmwtccLlQk3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":19832},"type":"module","_from":"file:publint-pack-0.1.2.tgz","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"bluwy","email":"bjornlu.dev@gmail.com"},"_resolved":"/tmp/1d1bb18747560b64d1cc9aa4f3842b3c/publint-pack-0.1.2.tgz","_integrity":"sha512-S+9ANAvUmjutrshV4jZjaiG8XQyuJIZ8a4utWmN/vW1sgQ9IfBnPndwkmQYw53QmouOIytT874u65HEmu6H5jw==","repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"_npmVersion":"10.9.2","description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.6","fs-fixture":"^2.7.1"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.2_1741015428399_0.7578201744152109","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@publint/pack","version":"0.1.3","keywords":["utilities","pack","unpack","npm"],"author":{"name":"Bjorn Lu"},"license":"MIT","_id":"@publint/pack@0.1.3","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/publint/publint#readme","bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"624ee3963e43596e8442c7b86cdfe0b1faf6e674","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.3.tgz","fileCount":15,"integrity":"sha512-dHDWeutAerz+Z2wFYAce7Y51vd4rbLBfUh0BNnyul4xKoVsPUVJBrOAFsJvtvYBwGFJSqKsxyyHf/7evZ8+Q5Q==","signatures":[{"sig":"MEUCIQCSvPmbqBO9ak/5tAwC9BttB3VPsinwP2KcY+ZQqvgzoQIgcotB9UAWluq2AeUgi7Iuvp7aheQZzS/ncByalZ98FgQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":22571},"type":"module","_from":"file:publint-pack-0.1.3.tgz","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"_resolved":"/tmp/5f487c16ae60341a5c259d6bae322140/publint-pack-0.1.3.tgz","_integrity":"sha512-dHDWeutAerz+Z2wFYAce7Y51vd4rbLBfUh0BNnyul4xKoVsPUVJBrOAFsJvtvYBwGFJSqKsxyyHf/7evZ8+Q5Q==","repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"_npmVersion":"11.6.2","description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.17","fs-fixture":"^2.11.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.3_1769010654399_0.1181455580091475","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@publint/pack","version":"0.1.4","keywords":["utilities","pack","unpack","npm"],"author":{"name":"Bjorn Lu"},"license":"MIT","_id":"@publint/pack@0.1.4","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"homepage":"https://github.com/publint/publint#readme","bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"866a82a1a8ab52329ae08baec6f3969ed99a30bf","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.4.tgz","fileCount":15,"integrity":"sha512-HDVTWq3H0uTXiU0eeSQntcVUTPP3GamzeXI41+x7uU9J65JgWQh3qWZHblR1i0npXfFtF+mxBiU2nJH8znxWnQ==","signatures":[{"sig":"MEQCICgBsldfc63lkNAJI+AAttK7d8InWWwtmFXOIOqF/BhRAiBdSzuUzxBS0DX3F1BhZdfMLSl8RTR/qVerQJc4RUPO7Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23015},"type":"module","_from":"file:publint-pack-0.1.4.tgz","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"_resolved":"/tmp/151bcc14673afdcca358fdd05fc99096/publint-pack-0.1.4.tgz","_integrity":"sha512-HDVTWq3H0uTXiU0eeSQntcVUTPP3GamzeXI41+x7uU9J65JgWQh3qWZHblR1i0npXfFtF+mxBiU2nJH8znxWnQ==","repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"_npmVersion":"11.6.2","description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","fs-fixture":"^2.11.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.4_1770311222249_0.6763362531967179","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@publint/pack","version":"0.1.5","keywords":["utilities","pack","unpack","npm"],"author":"Bjorn Lu","license":"MIT","_id":"@publint/pack@0.1.5","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"3b87dbcc086560944c3564bf9d05c5a1d115fe85","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.5.tgz","fileCount":15,"integrity":"sha512-edgyN2pP07uXiP4tJs0s8KVmU8M8i60YPbbI0/WDeok1mIJHRXz+CgD8I0nelwDkoCh3EWL/G5kGfbuHjsdbvw==","signatures":[{"sig":"MEUCIQCEj+A1nRBrspw+f5smfFj2ab5anUSE7UcQCrP2VyudaQIgSsvNy540z/nVyDgU+/uKQsIENWUT9qw5BAwOOKxKcjg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23576},"type":"module","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"24.16.0","dependencies":{"tinyexec":"^1.2.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.9","fs-fixture":"^2.14.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.5_1781679998206_0.22679023320024316","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@publint/pack","version":"0.1.6","keywords":["utilities","pack","unpack","npm"],"author":"Bjorn Lu","license":"MIT","_id":"@publint/pack@0.1.6","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"bugs":{"url":"https://github.com/publint/publint/issues"},"dist":{"shasum":"0ff2ee9aeafad2d8604f03bfb80e12177c5a0329","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.6.tgz","fileCount":16,"integrity":"sha512-3uVNyGcVplhPZSLVyeIpL7+cIRn1YCSNHLG/rUIlBQMVH8YuN9++YF+5+UDIIO9RW98dujiUoTltO7RDB5bFJA==","signatures":[{"sig":"MEUCIQDW/9x+2WVr06ozsYsHI3uv1peiV1u5FM77t5473xksHwIgXK8k5a11k6JuUiW3PeCLIsVxMDBasyeuT9s0zGrj6/s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":24331},"type":"module","engines":{"node":">=18"},"exports":{"types":"./src/index.d.ts","browser":"./src/index-browser.js","default":"./src/index-node.js"},"funding":"https://bjornlu.com/sponsor","scripts":{"test":"vitest run","test-dev":"vitest","typecheck":"tsc","lint-publint":"node ../publint/src/cli.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"repository":{"url":"git+https://github.com/publint/publint.git","type":"git","directory":"packages/pack"},"description":"Utilities for packing and unpacking npm packages","directories":{},"_nodeVersion":"24.18.0","dependencies":{"tinyexec":"^1.2.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.10","fs-fixture":"^2.14.0"},"_npmOperationalInternal":{"tmp":"tmp/pack_0.1.6_1784771807269_0.3369648144681019","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@publint/pack","version":"0.1.7","description":"Utilities for packing and unpacking npm packages","type":"module","author":"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"],"dependencies":{"tinyexec":"^1.3.0"},"devDependencies":{"fs-fixture":"^2.14.0","vitest":"^4.1.10"},"scripts":{"test":"vitest run","test-dev":"vitest","lint-publint":"node ../publint/src/cli.js","typecheck":"tsc"},"_nodeVersion":"24.19.0","_id":"@publint/pack@0.1.7","dist":{"integrity":"sha512-4EDEmvxWtgsCnnVeBvtFIFZtUhPPt1+bA9JrSwU4Sa//6oKtzCSlGGXYJr44OD9aGISymbieJ4mCKHUygUDU+g==","shasum":"f9db093808ccfd45f4b110bd5dd5a3c8a15655f6","tarball":"https://registry.npmjs.org/@publint/pack/-/pack-0.1.7.tgz","fileCount":16,"unpackedSize":24547,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@publint%2fpack@0.1.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFBdiMs0yvtZg7O+Imoia72jMdl3FLeEoCvPjtfe+t8DAiEAk9xUnJX79DtN+P8JMVbKPeXQqrlSUmut2Dhu5dXuegk="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:73c98fdb-ec61-4cf2-9dfb-cc9b95148809"}},"directories":{},"maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pack_0.1.7_1787121479478_0.5522976212117354"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-06T14:10:41.718Z","modified":"2026-08-19T06:37:59.994Z","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","0.1.5":"2026-06-17T07:06:38.413Z","0.1.6":"2026-07-23T01:56:47.400Z","0.1.7":"2026-08-19T06:37:59.625Z"},"bugs":{"url":"https://github.com/publint/publint/issues"},"author":"Bjorn Lu","license":"MIT","keywords":["utilities","pack","unpack","npm"],"repository":{"type":"git","url":"git+https://github.com/publint/publint.git","directory":"packages/pack"},"description":"Utilities for packing and unpacking npm packages","maintainers":[{"name":"bluwy","email":"bjornlu.dev@gmail.com"}],"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, v12)\n- yarn (v3, v4)\n- pnpm (v8, v9, v10, v11)\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\n","readmeFilename":""}