# rmfr

> Node.js implementation of `rm -fr` – recursive removal of files and directories

Latest version **2.0.0** (published 2018-03-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install rmfr
pnpm add rmfr
yarn add rmfr
bun add rmfr
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-03-02 |
| First published | 2016-08-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/rmfr) |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.6 KB |
| 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/rmfr
- Repository: https://github.com/shinnn/rmfr
- Homepage: https://github.com/shinnn/rmfr#readme
- Issues: https://github.com/shinnn/rmfr/issues
- npm.io page: https://npm.io/package/rmfr

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.2
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.2
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.11
- [inspect-with-kind](https://npm.io/package/inspect-with-kind.md) ^1.0.4
- [assert-valid-glob-opts](https://npm.io/package/assert-valid-glob-opts.md) ^1.0.0

## 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) — 2018-03-02
- 2.0.0-2 (next) — 2018-01-22
- 2.0.0-4 — 2018-02-28
- 2.0.0-3 — 2018-01-25
- 2.0.0-1 — 2018-01-22
- 2.0.0-0 — 2018-01-18
- 1.0.8 — 2018-01-10
- 1.0.7 — 2018-01-07
- 1.0.6 — 2018-01-05
- 1.0.5 — 2018-01-03
- 1.0.4 — 2018-01-01
- 1.0.3 — 2017-05-23
- 1.0.2 — 2017-01-26
- 1.0.1 — 2016-08-05
- 1.0.0 — 2016-08-03
- … 2 more at https://npm.io/package/rmfr/versions

## README

# rmfr

[![npm version](https://img.shields.io/npm/v/rmfr.svg)](https://www.npmjs.com/package/rmfr)
[![Build Status](https://travis-ci.org/shinnn/rmfr.svg?branch=master)](https://travis-ci.org/shinnn/rmfr)
[![Build status](https://ci.appveyor.com/api/projects/status/afcmk50xuig9jfs7/branch/master?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/rmfr/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/shinnn/rmfr/badge.svg?branch=master)](https://coveralls.io/github/shinnn/rmfr?branch=master)

[Node.js](https://nodejs.org/) implementation of `rm -fr` – recursive removal of files and directories

```javascript
const rmfr = require('rmfr');

(async () => await rmfr('path/to/target'))();
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install rmfr
```

## API

```javascript
const rmfr = require('rmfr');
```

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

*path*: `string` (a file/directory path)  
*options*: `Object`  
Return: `Promise`

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

When it fails to remove a target, it will be [*rejected*](https://promisesaplus.com/#point-30) with an error as its first argument.

#### Options

All [`rimraf`](https://github.com/isaacs/rimraf) [options](https://github.com/isaacs/rimraf#options) except for `disableGlob` are available, with some differences:

* `glob` option defaults to `false`.
  * If you want to specify targets using glob pattern, set `glob` option `true` or provide a [`node-glob` options object](https://github.com/isaacs/node-glob#options).
* `unlink`, `chmod`, `rmdir` and `readdir` options default to the corresponding [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) methods.

```javascript
const rmfr = require('rmfr');

rmfr('inde*.js'); // doesn't remove `./index.js`
rmfr('inde*.js', {glob: true}); // removes `./index.js`
```

## License

[ISC License](./LICENSE) © 2017 - 2018 Shinnosuke Watanabe

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