{"name":"del","version":"8.0.1","keywords":["delete","files","folders","directories","remove","destroy","trash","unlink","clean","cleaning","cleanup","rm","rmrf","rimraf","rmdir","glob","gulpfriendly","file","folder","directory","fs","filesystem"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"del@8.0.1","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/del#readme","bugs":{"url":"https://github.com/sindresorhus/del/issues"},"ava":{"serial":true,"workerThreads":false},"dist":{"shasum":"86772fe3a8c9f91bad0d7c6f79e04c6f310e50ac","tarball":"http://registry-npm.ywwl.com/del/download/del-8.0.1.tgz","fileCount":5,"integrity":"sha512-gPqh0mKTPvaUZGAuHbrBUYKZWBNAeHG7TU3QH5EhVwPMyKvmfJaNXhcD2jTcXsJRRcffuho4vaYweu80dRrMGA==","signatures":[{"sig":"MEYCIQDdCutCGxdDVoaj18B7qqxWOSNw1Nr7z2BwfGSdwsPtJwIhAPtPanbipRf3ckMTxysvIihLpR9YawVzsiWdFoxTyXeD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12731,"size":4085,"noattachment":false,"key":"/del/-/del-8.0.1.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"f9412a3d60895a3ce3d5d62ba323112cec291838","scripts":{"test":"xo && ava && tsd","bench":"node benchmark.js"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/del.git","type":"git"},"_npmVersion":"10.9.2","description":"Delete files and directories","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","dependencies":{"p-map":"^7.0.2","slash":"^5.1.0","globby":"^14.0.2","is-glob":"^4.0.3","is-path-cwd":"^3.0.0","is-path-inside":"^4.0.0","presentable-error":"^0.0.1"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.59.3","ava":"^6.1.3","tsd":"^0.31.2","tempy":"^3.1.0","benchmark":"^2.1.4"},"_npmOperationalInternal":{"tmp":"tmp/del_8.0.1_1758206827989_0.8399609443745579","host":"s3://npm-registry-packages-npm-production"},"readme":"# del\n\n> Delete files and directories using [globs](https://github.com/sindresorhus/globby#globbing-patterns)\n\nSimilar to [rimraf](https://github.com/isaacs/rimraf), but with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above.\n\n## Install\n\n```sh\nnpm install del\n```\n\n## Usage\n\n```js\nimport {deleteAsync} from 'del';\n\nconst deletedFilePaths = await deleteAsync(['temp/*.js', '!temp/unicorn.js']);\nconst deletedDirectoryPaths = await deleteAsync(['temp', 'public']);\n\nconsole.log('Deleted files:\\n', deletedFilePaths.join('\\n'));\nconsole.log('\\n\\n');\nconsole.log('Deleted directories:\\n', deletedDirectoryPaths.join('\\n'));\n```\n\n## Beware\n\nThe glob pattern `**` matches all children and *the parent*.\n\nSo this won't work:\n\n```js\ndeleteSync(['public/assets/**', '!public/assets/goat.png']);\n```\n\nYou have to explicitly ignore the parent directories too:\n\n```js\ndeleteSync(['public/assets/**', '!public/assets', '!public/assets/goat.png']);\n```\n\nTo delete all subdirectories inside `public/`, you can do:\n\n```js\ndeleteSync(['public/*/']);\n```\n\nSuggestions on how to improve this welcome!\n\n## API\n\nNote that glob patterns can only contain forward-slashes, not backward-slashes. Windows file paths can use backward-slashes as long as the path does not contain any glob-like characters, otherwise use `path.posix.join()` instead of `path.join()`.\n\n### deleteAsync(patterns, options?)\n\nReturns `Promise<string[]>` with the deleted paths.\n\n### deleteSync(patterns, options?)\n\nReturns `string[]` with the deleted paths.\n\n#### patterns\n\nType: `string | string[]`\n\nSee the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).\n\n- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)\n- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)\n\n#### options\n\nType: `object`\n\nYou can specify any of the [`globby` options](https://github.com/sindresorhus/globby#options) in addition to the below options. In contrast to the `globby` defaults, `expandDirectories`, `onlyFiles`, and `followSymbolicLinks` are `false` by default.\n\n##### force\n\nType: `boolean`\\\nDefault: `false`\n\nAllow deleting the current working directory and outside.\n\n##### dryRun\n\nType: `boolean`\\\nDefault: `false`\n\nSee what would be deleted.\n\n```js\nimport {deleteAsync} from 'del';\n\nconst deletedPaths = await deleteAsync(['temp/*.js'], {dryRun: true});\n\nconsole.log('Files and directories that would be deleted:\\n', deletedPaths.join('\\n'));\n```\n\n##### dot\n\nType: `boolean`\\\nDefault: `false`\n\nAllow patterns to match files/folders that start with a period (`.`).\n\nThis option is passed through to [`fast-glob`](https://github.com/mrmlnc/fast-glob#dot).\n\nNote that an explicit dot in a portion of the pattern will always match dot files.\n\n**Example**\n\n```\ndirectory/\n├── .editorconfig\n└── package.json\n```\n\n```js\nimport {deleteSync} from 'del';\n\ndeleteSync('*', {dot: false});\n//=> ['package.json']\ndeleteSync('*', {dot: true});\n//=> ['.editorconfig', 'package.json']\n```\n\n##### concurrency\n\nType: `number`\\\nDefault: `Infinity`\\\nMinimum: `1`\n\nConcurrency limit.\n\n##### onProgress\n\nType: `(progress: ProgressData) => void`\n\nCalled after each file or directory is deleted.\n\n```js\nimport {deleteAsync} from 'del';\n\nawait deleteAsync(patterns, {\n\tonProgress: progress => {\n\t// …\n}});\n```\n\n###### ProgressData\n\n```js\n{\n\ttotalCount: number,\n\tdeletedCount: number,\n\tpercent: number,\n\tpath?: string\n}\n```\n\n- `percent` is a value between `0` and `1`\n- `path` is the absolute path of the deleted file or directory. It will not be present if nothing was deleted.\n\n## CLI\n\nSee [del-cli](https://github.com/sindresorhus/del-cli) for a CLI for this module and [trash-cli](https://github.com/sindresorhus/trash-cli) for a safe version that is suitable for running by hand.\n\n## Related\n\n- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed\n- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching\n","publish_time":1758206828181,"_cnpm_publish_time":1758206828181,"dist-tags":{"latest":"9.0.1"}}