@alexbinary/rimraf

1.0.2Β β€’Β PublicΒ β€’Β Published

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

Install

npm i @alexbinary/rimraf

DownloadsWeekly Downloads

32

Version

1.0.2

License

MIT

Last publish

Collaborators

  • alexbinary