# await-callback

> Wrap and await callback code

Latest version **1.1.0** (published 2020-11-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install await-callback
pnpm add await-callback
yarn add await-callback
bun add await-callback
```

## 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.1.0 |
| Published | 2020-11-13 |
| First published | 2020-05-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brecht Savelkoul |
| Maintainers | savelbr |
| Keywords | callback, promise, async, await, encapsulate, wrap |

## Links

- npm: https://www.npmjs.com/package/await-callback
- Repository: https://github.com/brechtcs/await-callback
- Homepage: https://github.com/brechtcs/await-callback#readme
- Issues: https://github.com/brechtcs/await-callback/issues
- npm.io page: https://npm.io/package/await-callback

## Dependencies (2)

- [once](https://npm.io/package/once.md) ^1.4.0
- [configure-this](https://npm.io/package/configure-this.md) ^1.0.0

## Recent versions

- 1.1.0 (latest) — 2020-11-13
- 1.0.1 — 2020-05-02
- 1.0.0 — 2020-05-02

## README

# await-callback

Wrap and await callback code

## Usage

```js
var promise = require('await-callback')
var fs = require('fs')

async function main () {
  var result = await promise(done => {
    fs.writeFile('hello', 'world', 'utf8', err => {
      if (err) return done(err)
      fs.readFile('hello', 'utf8', done)
    })
  })

  console.log(result) // 'world'
}

main()
```

## License

Apache-2.0

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