# await-write

> Await write and end methods of a node writable stream.

Latest version **1.0.0** (published 2019-09-04) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2019-09-04 |
| First published | 2019-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hu Xiaodi |
| Maintainers | didyhu |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2019-09-04

## README

# await-write

Await node writable's `write()` and `end()` methods as promises.

## awaitWrite

```awaitWrite(writeable,buffer)```

* writeable `{stream.Writable}`
* buffer `{Buffer}`

The function returns when the `writable` object is drain.

## awaitEnd

```awaitEnd(writeable)```

* writeable `{stream.Writable}`

The function returns when the `writable` object is finished.

## Example

```javascript
const { awaitWrite, awaitEnd } = require("await-write")

// ...

try{
    await awaitWrite(writable,Buffer.from("hello "))
    await awaitWrite(writable,Buffer.from("world!"))
    await awaitEnd(writeable)
}catch(e){
    // handle error
}
```

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