Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delete

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delete

Delete files and folders and any intermediate directories if they exist (sync and async).

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by12.18%
Maintainers
1
Weekly downloads
 
Created
Source

delete NPM version Build Status

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');

// async
del('tmp/foo.md', function(err) {
  if (err) console.log(err);
});

// sync
del.sync('tmp/foo.md');

// promise
del.promise('foo/bar/baz.txt')
  .then(function() {
    //=> do stuff
  });

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});
  • 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.

Keywords

FAQs

Package last updated on 09 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc