# end-stream

> A stream that ends after computation finishes

Latest version **0.1.0** (published 2012-11-18) · 0 weekly downloads

## Install

```sh
npm install end-stream
pnpm add end-stream
yarn add end-stream
bun add end-stream
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2012-11-18 |
| First published | 2012-11-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Raynos |
| Maintainers | raynos |

## Links

- npm: https://www.npmjs.com/package/end-stream
- Repository: https://github.com/Raynos/end-stream
- Issues: https://github.com/Raynos/end-stream/issues
- npm.io page: https://npm.io/package/end-stream

## Dependencies (1)

- [write-stream](https://npm.io/package/write-stream.md) ~0.4.3

## Recent versions

- 0.1.0 (latest) — 2012-11-18

## README

# end-stream

A stream that ends after computation finishes

## Example

When you end this writable stream it will only emit `"finish"`
    after it's finished asynchronously writing each chunk
    you've written to the stream

```js
var stream = EndStream(function write(value, cb) {
    // do something async
    async(value, function (err) {
        // tell cb that your done writing it.
        // Optionally pass it an err as a shorthand for
        // stream.emit("error", err)
        cb(err)
    })
})

stream.write(foo)
stream.write(bar)

stream.end()
stream.on("finish", function () {
    // only called after both foo and bar have been
    // asynchronously written. e.g. persisted to db.
})
```

## Installation

`npm install end-stream`

## Contributors

 - Raynos

## MIT Licenced

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