# chmodrp

> `chmod -R` with the Promise API

Latest version **1.0.2** (published 2022-05-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-05-11 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Leon Si |
| Maintainers | leonzalion |
| Keywords | chmod, chmodr, recursive, promise, fs |

## Links

- npm: https://www.npmjs.com/package/chmodrp
- Repository: https://github.com/leonzalion/chmodrp
- Homepage: https://github.com/leonzalion/chmodrp#readme
- npm.io page: https://npm.io/package/chmodrp

## 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

- 1.0.2 (latest) — 2022-05-11
- 1.0.1 — 2022-05-10
- 1.0.0 — 2022-05-10

## README

# chmodrp

[![npm version](https://img.shields.io/npm/v/chmodrp)](https://npmjs.com/package/chmodrp)

A port of [isaacs's chmodr](https://github.com/isaacs/chmodr) but using the Promise API.\
Has the same effect as the command line command: `chmod -R`.

## Install

```shell
npm install chmodrp
```

## API

### chmodr(path, mode)

Returns: `Promise<void>`

Takes the same arguments as [`fs.promises.chmod()`](https://nodejs.org/api/fs.html#fspromiseschmodpath-mode)

#### path

Type: `string`

The path of the file to recursively `chmod`.

#### mode

Type: `number`

The file mode to `chmod` the files with.

### chmodrSync(path, mode)

Returns: `void`

Does the same thing as `chmodr(path, mode)` but synchronously.

## Usage

```typescript
import { chmodr, chmodrSync } from 'chmodrp';

await chmodr('/var/www/my/test/folder', 0o777);
chmodrSync('/var/www/my/test/folder2', 0o777);
```

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