UNPKG

canonical

Version:

Canonical code style linter and formatter for JavaScript, SCSS and CSS.

104 lines (103 loc) 4.45 kB
{ "_args": [ [ "del@https://registry.npmjs.org/del/-/del-2.2.0.tgz", "/Users/gajus/Documents/dev/canonical-code-style/canonical" ] ], "_from": "del@>=2.0.2 <3.0.0", "_id": "del@2.2.0", "_inCache": true, "_location": "/del", "_phantomChildren": {}, "_requested": { "name": "del", "raw": "del@https://registry.npmjs.org/del/-/del-2.2.0.tgz", "rawSpec": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", "scope": null, "spec": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", "type": "remote" }, "_requiredBy": [ "/flat-cache" ], "_resolved": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", "_shasum": "9a50f04bf37325e283b4f44e985336c252456bd5", "_shrinkwrap": null, "_spec": "del@https://registry.npmjs.org/del/-/del-2.2.0.tgz", "_where": "/Users/gajus/Documents/dev/canonical-code-style/canonical", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/del/issues" }, "dependencies": { "globby": "^4.0.0", "is-path-cwd": "^1.0.0", "is-path-in-cwd": "^1.0.0", "object-assign": "^4.0.1", "pify": "^2.0.0", "pinkie-promise": "^2.0.0", "rimraf": "^2.2.8" }, "description": "Delete files/folders using globs", "devDependencies": { "fs-extra": "^0.26.2", "mocha": "*", "path-exists": "^2.0.0", "xo": "*" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "homepage": "https://github.com/sindresorhus/del#readme", "keywords": [ "clean", "cleaning", "cleanup", "del", "delete", "destroy", "dir", "directory", "file", "files", "filesystem", "folder", "fs", "glob", "gulpfriendly", "remove", "rimraf", "rm", "rmdir", "rmrf", "trash", "unlink" ], "license": "MIT", "name": "del", "optionalDependencies": {}, "readme": "# del [![Build Status](https://travis-ci.org/sindresorhus/del.svg?branch=master)](https://travis-ci.org/sindresorhus/del)\n\n> Delete files and folders using [globs](https://github.com/isaacs/minimatch#usage)\n\nPretty much [rimraf](https://github.com/isaacs/rimraf) 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\n## Install\n\n```\n$ npm install --save del\n```\n\n\n## Usage\n\n```js\nconst del = require('del');\n\ndel(['tmp/*.js', '!tmp/unicorn.js']).then(paths => {\n\tconsole.log('Deleted files and folders:\\n', paths.join('\\n'));\n});\n```\n\n\n## Beware\n\nThe glob pattern `**` matches all children and *the parent*.\n\nSo this won't work:\n\n```js\ndel.sync(['public/assets/**', '!public/assets/goat.png']);\n```\n\nYou have to explicitly ignore the parent directories too:\n\n```js\ndel.sync(['public/assets/**', '!public/assets', '!public/assets/goat.png']);\n```\n\nSuggestions on how to improve this welcome!\n\n\n## API\n\n### del(patterns, [options])\n\nReturns a promise for an array of deleted paths.\n\n### del.sync(patterns, [options])\n\nReturns an array of deleted paths.\n\n#### patterns\n\nType: `string`, `array`\n\nSee supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).\n\n- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js)\n- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)\n\n#### options\n\nType: `object`\n\nSee the `node-glob` [options](https://github.com/isaacs/node-glob#options).\n\n##### force\n\nType: `boolean` \nDefault: `false`\n\nAllow deleting the current working directory and files/folders outside it.\n\n##### dryRun\n\nType: `boolean` \nDefault: `false`\n\nSee what would be deleted.\n\n```js\nconst del = require('del');\n\ndel(['tmp/*.js'], {dryRun: true}).then(paths => {\n\tconsole.log('Files and folders that would be deleted:\\n', paths.join('\\n'));\n});\n```\n\n\n## CLI\n\nSee [trash-cli](https://github.com/sindresorhus/trash-cli).\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/del.git" }, "scripts": { "test": "xo && mocha" }, "version": "2.2.0", "xo": { "envs": [ "mocha", "node" ] } }