@alexbinary/rimraf

Simple rimraf with promise support 🎉

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
20Dec 29, 2016Dec 18, 2016Minified + gzip package size for @alexbinary/rimraf in KB

Readme

rimraf

Simple rimraf with promise support 🎉

npm GitHub release Build Status dependencies Status devDependencies Status

Based on rimraf by isaacs

Uses @alexbinary/promisify by alexbinary

Install

Install using npm or yarn :

$ npm install @alexbinary/rimraf
# or
$ yarn add @alexbinary/rimraf

Usage

let rimraf = require('@alexbinary/rimraf')

// promise
rimraf('/foo/bar').then(() => {
  console.log('file deleted')
})

// callback
rimraf('/foo/bar', (err) => {
  if (!err) {
    console.log('file deleted')
  }
})

// sync
rimraf.sync('/foo/bar')
console.log('file deleted')

Documentation

let rimraf = require('@alexbinary/rimraf')

rimraf(filepath[, callback])

Removes the file or directory at filepath. If filepath is a directory then the directory is removed with all its content.

This method supports both Promise and node callback style, and resolves with no arguments.

rimraf.sync(filepath)

Synchronous version.

Licence

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.