Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexbinary/rimraf
Simple rimraf with promise support 🎉
https://github.com/alexbinary/rimraf
Last synced: 1 day ago
JSON representation
Simple rimraf with promise support 🎉
- Host: GitHub
- URL: https://github.com/alexbinary/rimraf
- Owner: alexbinary
- License: mit
- Created: 2016-12-18T13:32:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-29T10:19:59.000Z (almost 8 years ago)
- Last Synced: 2024-11-09T21:43:33.512Z (7 days ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# rimraf
Simple rimraf with promise support 🎉
[![npm](https://img.shields.io/npm/v/@alexbinary/rimraf.svg)](https://www.npmjs.com/package/@alexbinary/rimraf)
[![GitHub release](https://img.shields.io/github/release/alexbinary/rimraf.svg?label="github")](https://github.com/alexbinary/rimraf/releases/latest)
[![Build Status](https://travis-ci.org/alexbinary/rimraf.svg)](https://travis-ci.org/alexbinary/rimraf)
[![dependencies Status](https://david-dm.org/alexbinary/rimraf/status.svg)](https://david-dm.org/alexbinary/rimraf)
[![devDependencies Status](https://david-dm.org/alexbinary/rimraf/dev-status.svg)](https://david-dm.org/alexbinary/rimraf?type=dev)Based on [rimraf](https://www.npmjs.com/package/rimraf) by [isaacs](https://www.npmjs.com/~isaacs)
Uses [@alexbinary/promisify](https://www.npmjs.com/package/@alexbinary/promisify) by [alexbinary](https://www.npmjs.com/~alexbinary)
## Install
Install using npm or yarn :
```bash
$ npm install @alexbinary/rimraf
# or
$ yarn add @alexbinary/rimraf
```## Usage
```javascript
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
```javascript
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