{"name":"npm-packlist","version":"10.0.2","author":{"name":"GitHub Inc."},"license":"ISC","_id":"npm-packlist@10.0.2","maintainers":[{"name":"gar","email":"gar+npm@danger.computer"},{"name":"saquibkhan","email":"saquibkhan@github.com"},{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},{"name":"reggi","email":"reggi@github.com"},{"name":"hashtagchris","email":"hashtagchris@github.com"},{"name":"owlstronaut","email":"owlstronaut@github.com"}],"homepage":"https://github.com/npm/npm-packlist#readme","bugs":{"url":"https://github.com/npm/npm-packlist/issues"},"tap":{"files":["test/*.js"],"nyc-arg":["--exclude","tap-snapshots/**"],"test-env":["LC_ALL=sk"]},"dist":{"shasum":"b64877552bc9bf756c10a1795baa436f3d226370","tarball":"http://registry-npm.ywwl.com/npm-packlist/download/npm-packlist-10.0.2.tgz","fileCount":4,"integrity":"sha512-DrIWNiWT0FTdDRjGOYfEEZUNe1IzaSZ+up7qBTKnrQDySpdmuOQvytrqQlpK5QrCA4IThMvL4wTumqaa1ZvVIQ==","signatures":[{"sig":"MEYCIQCBoDLsOm5gfkkCz/wGczXxutd4xCkfn4B+F38v/z6cPAIhANKd8linLeQQCG4PT76ocpXD/U6RdsBvbx6ZvbfOXFAb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/npm-packlist@10.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":22562,"size":8045,"noattachment":false,"key":"/npm-packlist/-/npm-packlist-10.0.2.tgz"},"main":"lib/index.js","engines":{"node":"^20.17.0 || >=22.9.0"},"gitHead":"cc260642c38cb97f1c3a3f8f5c9ffa907f6c5fb6","scripts":{"lint":"npm run eslint","snap":"tap","test":"tap","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lintfix":"npm run eslint -- --fix","postlint":"template-oss-check","postsnap":"npm run lintfix --","posttest":"npm run lint","npmclilint":"npmcli-lint","template-oss-apply":"template-oss-apply --force"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e75df74e-40bf-4d43-80a2-40197ddf1bd9"}},"repository":{"url":"git+https://github.com/npm/npm-packlist.git","type":"git"},"_npmVersion":"11.6.0","description":"Get a list of the files to add from a folder into an npm package","directories":{"test":"test"},"templateOSS":{"publish":true,"version":"4.25.1","//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten."},"_nodeVersion":"22.19.0","dependencies":{"proc-log":"^5.0.0","ignore-walk":"^8.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^16.0.1","mutate-fs":"^2.1.1","@npmcli/arborist":"^9.0.0","@npmcli/template-oss":"4.25.1","@npmcli/eslint-config":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/npm-packlist_10.0.2_1758555571959_0.2822075296176345","host":"s3://npm-registry-packages-npm-production"},"readme":"# npm-packlist\n\nGet a list of the files to add from a folder into an npm package.\n\nThese can be handed to [tar](http://npm.im/tar) like so to make an npm\npackage tarball:\n\n```js\nconst Arborist = require('@npmcli/arborist')\nconst packlist = require('npm-packlist')\nconst tar = require('tar')\nconst packageDir = '/path/to/package'\nconst packageTarball = '/path/to/package.tgz'\n\nconst arborist = new Arborist({ path: packageDir })\narborist.loadActual().then((tree) => {\n  packlist(tree)\n    .then(files => tar.create({\n      prefix: 'package/',\n      cwd: packageDir,\n      file: packageTarball,\n      gzip: true\n    }, files))\n    .then(_ => {\n      // tarball has been created, continue with your day\n    })\n  })\n```\n\nThis uses the following rules:\n\n1. If a `package.json` file is found, and it has a `files` list,\n   then ignore everything that isn't matched by `files`.  Always include the\n   root readme, license, licence and copying files, if they exist, as well\n   as the package.json file itself.\n2. If there's no `package.json` file (or it has no `files` list), and\n   there is a `.npmignore` file, then ignore all the files in the\n   `.npmignore` file.\n3. If there's no `package.json` with a `files` list, and there's no\n   `.npmignore` file, but there is a `.gitignore` file, then ignore\n   all the files in the `.gitignore` file.\n4. Everything in the root `node_modules` is ignored, unless it's a\n   bundled dependency.  If it IS a bundled dependency, and it's a\n   symbolic link, then the target of the link is included, not the\n   symlink itself.\n5. Unless they're explicitly included (by being in a `files` list, or\n   a `!negated` rule in a relevant `.npmignore` or `.gitignore`),\n   always ignore certain common cruft files:\n\n    1. .npmignore and .gitignore files (their effect is in the package\n       already, there's no need to include them in the package)\n    2. editor junk like `.*.swp`, `._*` and `.*.orig` files\n    3. `.npmrc` files (these may contain private configs)\n    4. The `node_modules/.bin` folder\n    5. Waf and gyp cruft like `/build/config.gypi` and `.lock-wscript`\n    6. Darwin's `.DS_Store` files because wtf are those even\n    7. `npm-debug.log` files at the root of a project\n\n    You can explicitly re-include most of these with a negated ignore file rule.\n    A small set of files are always ignored regardless of `files` rules:\n    `.git`, `.npmrc`, and `node_modules`.\n\nOnly the `package.json` file in the very root of the project is ever\ninspected for a `files` list.  Below the top level of the root package,\n`package.json` is treated as just another file, and no package-specific\nsemantics are applied.\n\n### Interpretation of the `files` list\n\nEach entry in the `package.json` `files` list is interpreted as a glob\npattern, expanded against the package root using node's built-in\n[`fs.globSync`](https://nodejs.org/api/fs.html#fsglobsyncpattern-options).\nLiteral paths (`lib`, `src/index.js`) are valid globs and resolve to\nthemselves; pattern entries (`dist-*`, `**/*.js`) resolve to every\nmatching entry on disk; entries that match nothing are silently dropped.\n\nWhen an entry matches a directory, the directory and all of its contents\nare included.  This is a documented convenience: writing\n`\"files\": [\"dist\"]` does not require also writing `\"dist/**\"`.\n\nA leading `!` makes the entry a negation, removing matches from the\nresult.  Negations are evaluated in order, so a later positive entry\ncan re-include something a previous negation excluded.\n\n#### Pattern semantics are anchored to the package root\n\nGlob patterns are evaluated as paths relative to the package root, not as\nbasename-anywhere matchers.  In particular:\n\n* `\"*.js\"` matches `.js` files at the package root, not at every depth.\n  Use `\"**/*.js\"` to match at every depth.\n* `\"!readme.md\"` removes only the root `readme.md`.  Use\n  `\"!**/readme.md\"` to remove `readme.md` at every depth.\n\nNegations only exclude paths that exist on disk at packlist time: a `!path`\nentry that matches nothing is silently dropped, same as a positive entry\nthat matches nothing.  A typo'd negation has no effect.\n\n#### Interaction with `.npmignore`\n\nIf a `package.json` `files` array is present, any **top-level**\n`.npmignore` and `.gitignore` files are ignored: the `files` array is\nthe sole source of inclusion at the package root.\n\n`.npmignore` files in subdirectories are still honored within their\nsubtree.  For example, with this package.json:\n\n```json\n{\n  \"files\": [ \"dir\" ]\n}\n```\n\na `.npmignore` at `dir/.npmignore` (and any nested subdirectory) will\nbe applied.  This means a file listed both in `files` and excluded by a\nnested `.npmignore` will be excluded from the tarball; if you need such\na file to ship, remove the `.npmignore` rule.\n\n## API\n\nSame API as [ignore-walk](http://npm.im/ignore-walk), except providing a `tree` is required and there are hard-coded file list and rule sets.\n\nThe `Walker` class requires an [arborist](https://github.com/npm/cli/tree/latest/workspaces/arborist) tree, and if any bundled dependencies are found will include them as well as their own dependencies in the resulting file set.\n","publish_time":1758555572145,"_cnpm_publish_time":1758555572145,"dist-tags":{"latest":"11.3.1","legacy-v1":"1.4.8","prerelease":"7.0.0-pre.0"}}