Socket
Socket
Sign inDemoInstall

clear-dir

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clear-dir

For quickly emptying a directory


Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

clear-dir

For quickly emptying a directory.

NPM version Build Status Dependency Status

This module is optimised for situations where you just want the directory to be empty as soon as possible, and actually deleting the files can wait till later. First it moves all the directory's children into a temp directory so it can call your callback immediately, then it resursively deletes everything from the temp dir in a background job.

Usage

var clearDir = require('clear-dir');

clearDir(dir, emptiedCallback, finalCallback);
  • dir – the directory to empty
  • emptiedCallback – to be run when the contents have been cleared out of the directory
  • finalCallback (optional) – to be run when the contents have been deleted from the temp location

License

The MIT License

FAQs

Package last updated on 29 Jul 2014

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