{"name":"npm-packlist","version":"10.0.0","description":"Get a list of the files to add from a folder into an npm package","directories":{"test":"test"},"main":"lib/index.js","dependencies":{"ignore-walk":"^7.0.0"},"author":{"name":"GitHub Inc."},"license":"ISC","devDependencies":{"@npmcli/arborist":"^8.0.0","@npmcli/eslint-config":"^5.0.1","@npmcli/template-oss":"4.23.4","mutate-fs":"^2.1.1","tap":"^16.0.1"},"scripts":{"test":"tap","posttest":"npm run lint","snap":"tap","postsnap":"npm run lintfix --","eslint":"eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"","lint":"npm run eslint","lintfix":"npm run eslint -- --fix","npmclilint":"npmcli-lint","postlint":"template-oss-check","template-oss-apply":"template-oss-apply --force"},"repository":{"type":"git","url":"git+https://github.com/npm/npm-packlist.git"},"tap":{"test-env":["LC_ALL=sk"],"nyc-arg":["--exclude","tap-snapshots/**"],"files":["test/*.js"]},"engines":{"node":"^20.17.0 || >=22.9.0"},"templateOSS":{"//@npmcli/template-oss":"This file is partially managed by @npmcli/template-oss. Edits may be overwritten.","version":"4.23.4","publish":true},"_id":"npm-packlist@10.0.0","gitHead":"b50e3c4dd38212d223334e8901357e3d6557622b","bugs":{"url":"https://github.com/npm/npm-packlist/issues"},"homepage":"https://github.com/npm/npm-packlist#readme","_nodeVersion":"22.11.0","_npmVersion":"10.9.1","dist":{"integrity":"sha512-rht9U6nS8WOBDc53eipZNPo5qkAV4X2rhKE2Oj1DYUQ3DieXfj0mKkVmjnf3iuNdtMd8WfLdi2L6ASkD/8a+Kg==","shasum":"35634f0a90f84a811ebdf565eb78d2b36252888c","tarball":"http://registry-npm.ywwl.com/npm-packlist/download/npm-packlist-10.0.0.tgz","fileCount":4,"unpackedSize":22213,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/npm-packlist@10.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0SP1pubyX7813dDnh9nDD+Gld0XObmNDAIUszHX1cEgIgAbgmyEiPkCtp9/FhhARaGVBrtHU8Z8RgKj7HvB9mOMQ="}],"size":7944,"noattachment":false,"key":"/npm-packlist/-/npm-packlist-10.0.0.tgz"},"_npmUser":{"name":"npm-cli-ops","email":"npm-cli+bot@github.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-packlist_10.0.0_1732572096804_0.8936306861126442"},"_hasShrinkwrap":false,"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 in `files`.  Always include the root\n   readme, license, licence and copying files, if they exist, as well\n   as the package.json file itself. Non-root readme, license, licence and\n   copying files are included by default, but can be excluded using the \n   `files` list e.g. `\"!readme\"`.\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.\n4. 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 any of these with a `files` list in\n    `package.json` or a negated ignore file rule.\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### Interaction between `package.json` and `.npmignore` rules\n\nIn previous versions of this library, the `files` list in `package.json`\nwas used as an initial filter to drive further tree walking. That is no\nlonger the case as of version 6.0.0.\n\nIf you have a `package.json` file with a `files` array within, any top\nlevel `.npmignore` and `.gitignore` files *will be ignored*.\n\nIf a _directory_ is listed in `files`, then any rules in nested `.npmignore` files within that directory will be honored.\n\nFor example, with this package.json:\n\n```json\n{\n  \"files\": [ \"dir\" ]\n}\n```\n\na `.npmignore` file at `dir/.npmignore` (and any subsequent\nsub-directories) will be honored.  However, a `.npmignore` at the root\nlevel will be skipped.\n\nAdditionally, with this package.json:\n\n```\n{\n  \"files\": [\"dir/subdir\"]\n}\n```\n\na `.npmignore` file at `dir/.npmignore` will be honored, as well as `dir/subdir/.npmignore`.\n\nAny specific file matched by an exact filename in the package.json `files` list will be included, and cannot be excluded, by any `.npmignore` files.\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":1732572096959,"maintainers":[{"name":"fritzy","email":"fritzy@github.com"},{"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"}],"_cnpm_publish_time":1732572096959,"dist-tags":{"latest":"11.3.1","legacy-v1":"1.4.8","prerelease":"7.0.0-pre.0"}}