https://github.com/taskrjs/fly-clear
Remove one or multiple directories.
https://github.com/taskrjs/fly-clear
Last synced: 23 days ago
JSON representation
Remove one or multiple directories.
- Host: GitHub
- URL: https://github.com/taskrjs/fly-clear
- Owner: taskrjs
- License: mit
- Created: 2017-01-11T18:32:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-10T15:47:08.000Z (about 4 years ago)
- Last Synced: 2025-05-12T01:18:06.328Z (27 days ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# fly-clear [](https://travis-ci.org/flyjs/fly-clear)
> Remove one or multiple directories
## Install
```
$ npm install --save-dev fly-clear
```## Usage
```js
exports.cleanup = function * (fly) {
// single file
yield fly.clear('foo.js');// single directory
yield fly.clear('dist');// multiple directories
yield fly.clear(['dist', 'build']);// glob pattern(s)
yield fly.clear(['dist/*.css', 'dist/js/*']);// mixed
yield fly.clear(['foo.js', 'build', 'dist/*.css']);// with options
yield fly.clear('dist', {maxBusyTries: 5});
}
```## API
### fly.clear(files, [options])
#### files
Type: `string` or `array`
A filepath, directory path, or glob pattern. For multiple paths, use an `array`.
#### options
Type: `object`
Default: `{}`All options are passed directly to `rimraf`. Please see its [documentation on options](https://github.com/isaacs/rimraf#options).
## License
MIT © [Luke Edwards](http://flyjs.io)