stream.finished
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

stream.finished

Build Status npm

Polyfill for stream.finished in node versions < 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 in node v10.0.0 and later, and a replacement in other environments.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Installation

npm install stream.finished

Additionally for Typescript:

npm install -D @types/node

Usage

Direct

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

Typescript:

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

Shim

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

or:

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

Typescript:

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

or:

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

Package Sidebar

Install

npm i stream.finished

Weekly Downloads

27,156

Version

1.2.0

License

MIT

Unpacked Size

10.5 kB

Total Files

14

Last publish

Collaborators

  • dex4er