updated npm modules
This commit is contained in:
+14
-10
@@ -1,4 +1,4 @@
|
||||
# del [](https://travis-ci.org/sindresorhus/del) [](https://github.com/sindresorhus/xo)
|
||||
# del [](https://travis-ci.org/sindresorhus/del) [](https://github.com/xojs/xo)
|
||||
|
||||
> Delete files and folders using [globs](https://github.com/isaacs/minimatch#usage)
|
||||
|
||||
@@ -15,7 +15,7 @@ Similar to [rimraf](https://github.com/isaacs/rimraf), but with a Promise API an
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save del
|
||||
$ npm install del
|
||||
```
|
||||
|
||||
|
||||
@@ -24,9 +24,11 @@ $ npm install --save del
|
||||
```js
|
||||
const del = require('del');
|
||||
|
||||
del(['tmp/*.js', '!tmp/unicorn.js']).then(paths => {
|
||||
console.log('Deleted files and folders:\n', paths.join('\n'));
|
||||
});
|
||||
(async () => {
|
||||
const deletedPaths = await del(['tmp/*.js', '!tmp/unicorn.js']);
|
||||
|
||||
console.log('Deleted files and folders:\n', deletedPaths.join('\n'));
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
@@ -61,11 +63,11 @@ Returns an array of deleted paths.
|
||||
|
||||
#### patterns
|
||||
|
||||
Type: `string` `Array`
|
||||
Type: `string` `string[]`
|
||||
|
||||
See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage).
|
||||
|
||||
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js)
|
||||
- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test/test.js)
|
||||
- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns)
|
||||
|
||||
#### options
|
||||
@@ -91,9 +93,11 @@ See what would be deleted.
|
||||
```js
|
||||
const del = require('del');
|
||||
|
||||
del(['tmp/*.js'], {dryRun: true}).then(paths => {
|
||||
console.log('Files and folders that would be deleted:\n', paths.join('\n'));
|
||||
});
|
||||
(async () => {
|
||||
const deletedPaths = await del(['tmp/*.js'], {dryRun: true});
|
||||
|
||||
console.log('Files and folders that would be deleted:\n', deletedPaths.join('\n'));
|
||||
})();
|
||||
```
|
||||
|
||||
##### concurrency
|
||||
|
||||
Reference in New Issue
Block a user