{"name":"del","version":"1.2.0","description":"Delete files/folders using globs","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/del.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["delete","del","remove","destroy","trash","unlink","clean","cleaning","cleanup","rm","rmrf","rimraf","rmdir","glob","gulpfriendly","file","files","folder","dir","directory","fs","filesystem"],"dependencies":{"each-async":"^1.0.0","globby":"^2.0.0","is-path-cwd":"^1.0.0","is-path-in-cwd":"^1.0.0","object-assign":"^2.0.0","rimraf":"^2.2.8"},"devDependencies":{"fs-extra":"^0.18.3","mocha":"*","path-exists":"^1.0.0"},"gitHead":"c5fefd60664f7417045e26f8ea88a8482ac33654","bugs":{"url":"https://github.com/sindresorhus/del/issues"},"homepage":"https://github.com/sindresorhus/del#readme","_id":"del@1.2.0","_shasum":"3241336ead45a66c8f97215ae223c7e7947401c8","_from":".","_npmVersion":"2.10.0","_nodeVersion":"0.12.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"3241336ead45a66c8f97215ae223c7e7947401c8","tarball":"http://registry-npm.ywwl.com/del/download/del-1.2.0.tgz","integrity":"sha512-wk7WVyzWeWxmUscZN44CpSRY3s3fxY6dkVMp6sGC7EqC7Z1NrCk1GAje9hdnNpTwmwRCD3KbwUgXXA8g95JPJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/HVnjaaFhttkn6dxmWjuKsrmE/V4yItNBiB2JTNZg3QIgdRLSXRusiuN1ag7faaAKSVDq/L8RCr4WdFRiRDc0Dsg="}],"size":2414,"noattachment":false,"key":"/del/-/del-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"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## del for enterprise\n\nAvailable as part of the Tidelift Subscription.\n\nThe maintainers of del and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-del?utm_source=npm-del&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)\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":1432066546744,"_cnpm_publish_time":1432066546744,"dist-tags":{"latest":"9.0.1"}}