delete

Delete files and folders and any intermediate directories if they exist (sync and async).
Install
Install with npm
$ npm i delete --save
Usage
var del = require('delete');
del('tmp/foo.md', function(err) {
if (err) console.log(err);
});
del.sync('tmp/foo.md');
del.promise('foo/bar/baz.txt')
.then(function() {
});
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
- copy: Copy files or directories using globs.
- export-files: node.js utility for exporting a directory of files as modules.
- glob-fs: file globbing for node.js. speedy and powerful alternative to node-glob.
- micromatch: Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. Just… more
- read-data: Read JSON or YAML files.
- write: Write files to disk, creating intermediate directories if they don't exist.
- write-yaml: Write YAML. Converts JSON to YAML writes it to the specified file.
- write-json: Write a JSON to file disk, also creates directories in the dest path if they… more
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-cli on July 09, 2015.