|
|
пре 5 година | |
|---|---|---|
| .. | ||
| CHANGELOG.md | пре 5 година | |
| LICENSE | пре 5 година | |
| README.md | пре 5 година | |
| auto.d.ts | пре 5 година | |
| auto.js | пре 5 година | |
| implementation.js | пре 5 година | |
| index.d.ts | пре 5 година | |
| index.js | пре 5 година | |
| package.json | пре 5 година | |
| polyfill.d.ts | пре 5 година | |
| polyfill.js | пре 5 година | |
| shim.d.ts | пре 5 година | |
| shim.js | пре 5 година | |
| tsconfig.json | пре 5 година | |
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.
npm install stream.pipeline-shim
Additionally for Typescript:
npm install -D @types/node
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`
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`
Copyright (c) 2018-2019 Piotr Roszatycki piotr.roszatycki@gmail.com
Copyright Node.js contributors. All rights reserved.
Copyright (c) 2014 Mathias Buus