1.0.2 • Published 7 years ago

@alexbinary/rimraf v1.0.2

Weekly downloads
196
License
MIT
Repository
github
Last release
7 years ago

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