# promisify-tuple

> Promisify a callback-style function, always resolve with [err,val]

Latest version **1.2.0** (published 2021-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install promisify-tuple
pnpm add promisify-tuple
yarn add promisify-tuple
bun add promisify-tuple
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2021-05-19 |
| First published | 2018-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Andre Staltz |
| Maintainers | staltz |
| Keywords | chain, pipe, functions, functional, compose |

## Links

- npm: https://www.npmjs.com/package/promisify-tuple
- Repository: https://github.com/staltz/promisify-tuple
- Homepage: https://github.com/staltz/promisify-tuple#readme
- Issues: https://github.com/staltz/promisify-tuple/issues
- npm.io page: https://npm.io/package/promisify-tuple

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-05-19
- 1.1.0 — 2021-05-19
- 1.0.1 — 2019-12-20
- 1.0.0 — 2018-09-15

## README

# promisify-tuple

Convert a Node.js-style callback API `(err, val) => void` to a Promise that resolves to a `[err, val]` array.

```
npm install --save promisify-tuple
```

**Before:**

```js
const fs = require('fs')

function main() {
  fs.readFile('./test.js', (err, val) => {
    if (err) console.error(err)
    else console.log(val)
  })
}

main()
```

**After:**

```js
const fs = require('fs')
const run = require('promisify-tuple')

async function main() {
  const [err, val] = await run(fs.readFile)('./test.js')
  if (err) console.error(err)
  else console.log(val)
}

main()
```

## License

[MIT](LICENSE)

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