# rimraf-promise

> Promises/A+ version of rimraf

Latest version **2.0.0** (published 2015-10-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install rimraf-promise
pnpm add rimraf-promise
yarn add rimraf-promise
bun add rimraf-promise
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2015-10-20 |
| First published | 2014-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | rimraf, rm, rmdir, unlink, remove, clean, recursive, glob, file, directory, promise, promisified, then, thenable |

## Links

- npm: https://www.npmjs.com/package/rimraf-promise
- Repository: https://github.com/shinnn/rimraf-promise
- Homepage: https://github.com/shinnn/rimraf-promise#readme
- Issues: https://github.com/shinnn/rimraf-promise/issues
- npm.io page: https://npm.io/package/rimraf-promise

## Dependencies (1)

- [rimraf](https://npm.io/package/rimraf.md) ^2.4.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2015-10-20
- 1.0.0 — 2014-10-17
- 0.0.0 — 2014-10-16

## README

# rimraf-promise

[![NPM version](https://img.shields.io/npm/v/rimraf-promise.svg)](https://www.npmjs.com/package/rimraf-promise)
[![Build Status](https://travis-ci.org/shinnn/rimraf-promise.svg?branch=master)](https://travis-ci.org/shinnn/rimraf-promise)
[![Build status](https://ci.appveyor.com/api/projects/status/sa0vd3nhfiupeu7h?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/rimraf-promise)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/rimraf-promise.svg)](https://coveralls.io/r/shinnn/rimraf-promise)
[![Dependency Status](https://img.shields.io/david/shinnn/rimraf-promise.svg?label=deps)](https://david-dm.org/shinnn/rimraf-promise)
[![devDependency Status](https://img.shields.io/david/dev/shinnn/rimraf-promise.svg?label=devDeps)](https://david-dm.org/shinnn/rimraf-promise#info=devDependencies)

[Promises/A+][promise] version of [rimraf][rimraf]:

> `rm -rf` for node.

```javascript
const rimrafPromise = require('rimraf-promise');

rimrafPromise('path/should/be/removed')
.then(() => console.log('File has been removed successfully.'))
.catch(console.error);
```

## Installation

[Use npm.](https://docs.npmjs.com/cli/install)

```
npm install rimraf-promise
```

## API

```javascript
const rimrafPromise = require('rimraf-promise');
```

### rimrafPromise(*path* [, *options*])

*path*: `String` (a file/directory path or glob pattern)  
*options*: `Object` (rimraf [options](https://github.com/isaacs/rimraf/blob/4d3d9b5f2ddbbaf4ee56be5f8bfecdd4e27f7b34/rimraf.js#L22-L38))  
Return: `Object` ([Promise][promise])

When it finish removing the target, it will be [*fulfilled*](https://promisesaplus.com/#point-26) with no arguments.

When it fails to remove the target, it will be [*rejected*](https://promisesaplus.com/#point-30) with an error as its first argument. [Here](https://github.com/isaacs/rimraf#api) is the details about how [rimraf][rimraf] handles its error.

```javascript
const rirmafPromise = require('rimraf-promise');

const onFulfilled = () => console.log('Done.');
const onRejected = err => console.error(err);

rirmafPromise('path/to/file').then(onFulfilled, onRejected);
```

## License

[The Unlicense](./LICENSE)

[rimraf]: https://github.com/isaacs/rimraf
[promise]: https://promisesaplus.com/

---
_Source: https://npm.io/package/rimraf-promise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
