# gentle-fs

> Gentle Filesystem operations

Latest version **2.3.1** (published 2020-03-25) · Artistic-2.0 license · 0 weekly downloads

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

## Install

```sh
npm install gentle-fs
pnpm add gentle-fs
yarn add gentle-fs
bun add gentle-fs
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.3.1 |
| Published | 2020-03-25 |
| First published | 2017-09-15 |
| Weekly downloads | 0 |
| License | Artistic-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 30.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Mike Sherov |
| Maintainers | adam_baldwin, claudiahdz, darcyclarke, isaacs, ruyadorno |
| Keywords | npm, gentle, fs |

## Links

- npm: https://www.npmjs.com/package/gentle-fs
- Repository: https://github.com/npm/gentle-fs
- Homepage: https://github.com/npm/gentle-fs#readme
- Issues: https://github.com/npm/gentle-fs/issues
- npm.io page: https://npm.io/package/gentle-fs

## Dependencies (11)

- [iferr](https://npm.io/package/iferr.md) ^0.1.5
- [slide](https://npm.io/package/slide.md) ^1.1.6
- [aproba](https://npm.io/package/aproba.md) ^1.1.2
- [chownr](https://npm.io/package/chownr.md) ^1.1.2
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [cmd-shim](https://npm.io/package/cmd-shim.md) ^3.0.3
- [fs-vacuum](https://npm.io/package/fs-vacuum.md) ^1.2.10
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.11
- [infer-owner](https://npm.io/package/infer-owner.md) ^1.0.4
- [read-cmd-shim](https://npm.io/package/read-cmd-shim.md) ^1.0.1
- [path-is-inside](https://npm.io/package/path-is-inside.md) ^1.0.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 2.3.1 (latest) — 2020-03-25
- 2.3.0 — 2019-12-11
- 2.2.1 — 2019-08-15
- 2.2.0 — 2019-08-14
- 2.1.0 — 2019-08-14
- 2.0.1 — 2017-11-28
- 2.0.0 — 2017-10-07
- 1.0.2 — 2017-10-07
- 1.0.1 — 2017-09-25
- 1.0.0 — 2017-09-15

## README

# gentle-fs [![npm version](https://img.shields.io/npm/v/gentle-fs.svg)](https://npm.im/gentle-fs) [![license](https://img.shields.io/npm/l/gentle-fs.svg)](https://npm.im/gentle-fs) [![Travis](https://img.shields.io/travis/npm/gentle-fs.svg)](https://travis-ci.org/npm/gentle-fs) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/gentle-fs?svg=true)](https://ci.appveyor.com/project/npm/gentle-fs) [![Coverage Status](https://coveralls.io/repos/github/npm/gentle-fs/badge.svg?branch=latest)](https://coveralls.io/github/npm/gentle-fs?branch=latest)

[`gentle-fs`](https://github.com/npm/gentle-fs) is a standalone library for
"gently" remove or link directories.

## Install

`$ npm install gentle-fs`

## Table of Contents

* [Example](#example)
* [Features](#features)
* [API](#api)
  * [`rm`](#rm)
  * [`link`](#link)
  * [`linkIfExists`](#linkIfExists)

### Example

```javascript
// todo
```

### Features

* Performs filesystem operations "gently". Please see details in the API specs below
for a more precise definition of "gently".

### API

#### <a name="rm"></a> `> rm(target, opts, cb)`

Will delete all directories between `target` and `opts.base`, as long as they are empty.
That is, if `target` is `/a/b/c/d/e` and `base` is `/a/b`, but `/a/b/c` has other files
besides the `d` directory inside of it, `/a/b/c` will remain.

##### Example

```javascript
rm(target, opts, cb)
```

#### <a name="link"></a> `> link(from, to, opts, cb)`

If `from` is a real directory, and `from` is not the same directory as `to`, will
symlink `from` to `to`, while also gently [`rm`](#rm)ing the `to` directory,
and then call the callback. Otherwise, will call callback with an `Error`.

##### Example

```javascript
link(from, to, opts, cb)
```

#### <a name="linkIfExists"></a> `> linkIfExists(from, to, opts, cb)`

Performs the same operation as [`link`](#link), except does nothing when `from` is the
same as `to`, and calls the callback.

##### Example

```javascript
linkIfExists(from, to, opts, cb)
```

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