# stream.finished

> Polyfill/shim for stream.finished in node versions < v10

Latest version **1.2.0** (published 2019-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install stream.finished
pnpm add stream.finished
yarn add stream.finished
bun add stream.finished
```

## 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 | 2019-05-08 |
| First published | 2018-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Piotr Roszatycki |
| Maintainers | dex4er |
| Keywords | polyfill, shim, stream, stream.finished |

## Links

- npm: https://www.npmjs.com/package/stream.finished
- Repository: https://github.com/dex4er/js-stream.finished
- Homepage: http://github.com/dex4er/js-stream.finished
- Issues: https://github.com/dex4er/js-stream.finishe/issues
- npm.io page: https://npm.io/package/stream.finished

## Dependencies (2)

- [function-bind](https://npm.io/package/function-bind.md) ^1.1.1
- [define-properties](https://npm.io/package/define-properties.md) ^1.1.3

## 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) — 2019-05-08
- 1.1.2 — 2019-05-08
- 1.1.1 — 2018-09-18
- 1.1.0 — 2018-09-17
- 1.0.1 — 2018-05-15

## README

# stream.finished

<!-- markdownlint-disable MD013 -->
[![Build Status](https://secure.travis-ci.org/dex4er/js-stream.finished.svg)](http://travis-ci.org/dex4er/js-stream.finished) [![npm](https://img.shields.io/npm/v/stream.finished.svg)](https://www.npmjs.com/package/stream.finished)
<!-- markdownlint-enable MD013 -->

Polyfill for stream.finished in node versions &lt; v10

node v10.0.0 added support for a built-in `stream.finished`:
<https://github.com/nodejs/node/pull/19828>

This package provides the built-in
[`stream.finished`](https://nodejs.org/api/stream.html#stream_stream_finished_stream_callback)
in node v10.0.0 and later, and a replacement in other environments.

This package implements the [es-shim API](https://github.com/es-shims/api)
interface. It works in an ES3-supported environment and complies with the
[spec](http://www.ecma-international.org/ecma-262/6.0/).

## Installation

```shell
npm install stream.finished
```

_Additionally for Typescript:_

```shell
npm install -D @types/node
```

## Usage

### Direct

```js
const finished = require('stream.finished');
// Use `finished` just like the built-in method on `stream`
```

_Typescript:_

```ts
import finished from 'stream.finished';
// Use `finished` just like the built-in method on `stream`
```

### Shim

```js
require('stream.finished/shim')();
// `stream.finished` is now defined
const stream = require('stream');
// Use `stream.finished`
```

or:

```js
require('stream.finished/auto');
// `stream.finished` is now defined
const stream = require('stream');
// Use `stream.finished`
```

_Typescript:_

```js
import finishedShim from 'stream.finished/shim';
finishedShim();
// `stream.finished` is now defined
import stream from 'stream';
// Use `stream.finished`
```

or:

```js
import 'stream.finished/auto';
// `stream.finished` is now defined
import stream from 'stream';
// Use `stream.finished`
```

## License

Copyright (c) 2018-2019 Piotr Roszatycki <piotr.roszatycki@gmail.com>

Copyright Node.js contributors. All rights reserved.

Copyright (c) 2014 Mathias Buus

[MIT](https://opensource.org/licenses/MIT)

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