New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rmrf-promise

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rmrf-promise

rifraf wrapped in Promises

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rmrf-promise

The awesome rimraf package wrapped in Promises for removing files and folders recursively using Node.

Why?

While Node's built-in fs package works well for many file system operations, recursive folder deletion is somewhat inconsistent, especially in Windows. rimraf solved that problem by creating a library which can consistently remove folders. rmrf-promise does not add or take away anything from rimraf itself. All that rmrf-promise does is return Promises instead of taking callbacks when calling rimraf.

Installation

$ npm install rmrf-promise

Usage

rimraf(filePath, [options])

filePath is the path to the file or folder to be removed.

options is an optional object of rimraf options. To see all available options, click here.

Examples:

const rmrf = require('rmrf-promise');

// Usage with manual Promise handling
rmrf('some-file-path')
    .then(() => {
        // success!
    })
    .catch(err => {
        // handle error
    });

// Usage within an sync function
async function() {
    try {
        await rmrf('some-file-path');
        // success!
    } catch(err) {
        // handle error
    }
};

// Usage within a generator function
co(function*() {
    try {
        yield rmrf('some-file-path');
        // success!
    } catch(err) {
        // handle error
    }
});

Running Tests

$ npm install
$ npm test

License

Apache License Version 2.0

Keywords

FAQs

Package last updated on 29 Aug 2017

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