Package Exports
- delete
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (delete) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
delete

Delete files and folders and any intermediate directories if they exist (sync and async).
(TOC generated by verb using markdown-toc)
Install
Install with npm:
$ npm i delete --save
Usage
var del = require('delete');
// async
del(['foo/*.js'], function(err) {
if (err) throw err;
console.log('done!');
});
// sync
del.sync(['foo/*.js']);
// promise
del.promise(['foo/*.js'])
.then(function() {
//=> do stuff
});
Options
All methods take an options
object as the second argument.
options.force
(The force
option was inspired by grunt.)
An error is thrown if you try to delete files outside of the current working directory (cwd).
Override the default behavior:
del.sync('../foo.md', {force: true});
Related projects
- copy: Copy files or directories using globs. | homepage
- export-files: node.js utility for exporting a directory of files as modules. | homepage
- micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… more | homepage
- write: Write files to disk, creating intermediate directories if they don't exist. | homepage
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Jon Schlinkert
License
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb on December 27, 2015.