# util-promisifyall

> promisifyAll with node's native promisify function

Latest version **1.0.6** (published 2019-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install util-promisifyall
pnpm add util-promisifyall
yarn add util-promisifyall
bun add util-promisifyall
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2019-02-17 |
| First published | 2017-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Charlie Duong |
| Maintainers | charlieduong94 |
| Keywords | promisify |

## Links

- npm: https://www.npmjs.com/package/util-promisifyall
- Repository: https://github.com/charlieduong94/util-promisifyall
- Homepage: https://github.com/charlieduong94/util-promisifyall#readme
- Issues: https://github.com/charlieduong94/util-promisifyall/issues
- npm.io page: https://npm.io/package/util-promisifyall

## Recent versions

- 1.0.6 (latest) — 2019-02-17
- 1.0.5 — 2019-02-11
- 1.0.4 — 2018-07-31
- 1.0.3 — 2017-12-10
- 1.0.2 — 2017-09-05
- 1.0.1 — 2017-05-31
- 1.0.0 — 2017-05-31

## README

# util-promisifyAll

`bluebird`'s `promisifyAll` implemented with node 8.x's builtin `util.promisify`. For those
times when you don't want to pull in all of `bluebird` just to promisify some functions.

### Installation

```bash
npm i util-promisifyall
```

### Example Usage
This library wraps any traditional callback-based library and attempts
to promisify any function exported by the module or its prototype.

It does so by creating and exposing a "promisified" version of each function,
which can then be invoked by appending `Async` to the old function name, such as:

```
const promisifyAll = require('util-promisifyall'); // note lowercase 'a' in 'all'
const fs = promisifyAll(require('fs'));

const readDir = async (dir) => {
  try {
    const res = await fs.readdirAsync(dir);
    console.log(res);
    return res;
  } catch (error) {
    throw error;
  }
}
```

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