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

1.1.0 • Public • Published

stream.pipeline-shim

Build Status npm

Polyfill for stream.pipeline in node versions < v10

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

This package provides the built-in stream.pipeline in node v10.0.0 and later, and a replacement in other environments.

This module requires Node >= 5.

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

Installation

npm install stream.pipeline-shim

Additionally for Typescript:

npm install -D @types/node

Usage

Direct

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

Typescript:

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

Shim

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

or:

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

Typescript:

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

or:

import 'stream.pipeline-shim/auto';
// `stream.pipeline` is now defined
import stream from 'stream';
// Use `stream.pipeline`

License

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

Copyright Node.js contributors. All rights reserved.

Copyright (c) 2014 Mathias Buus

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    26,546
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    26,546
  • 1.0.4
    0
  • 1.0.2
    0
  • 1.0.1
    0

Package Sidebar

Install

npm i stream.pipeline-shim

Weekly Downloads

26,546

Version

1.1.0

License

MIT

Unpacked Size

13.6 kB

Total Files

14

Last publish

Collaborators

  • dex4er