Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dex4er/js-stream.pipeline-shim
Polyfill for stream.pipeline in node versions < v10
https://github.com/dex4er/js-stream.pipeline-shim
Last synced: about 2 months ago
JSON representation
Polyfill for stream.pipeline in node versions < v10
- Host: GitHub
- URL: https://github.com/dex4er/js-stream.pipeline-shim
- Owner: dex4er
- License: mit
- Created: 2018-05-14T20:52:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-08T20:05:15.000Z (over 5 years ago)
- Last Synced: 2024-10-08T17:43:34.966Z (3 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# stream.pipeline-shim
[![Build Status](https://secure.travis-ci.org/dex4er/js-stream.pipeline-shim.svg)](http://travis-ci.org/dex4er/js-stream.pipeline-shim) [![npm](https://img.shields.io/npm/v/stream.pipeline-shim.svg)](https://www.npmjs.com/package/stream.pipeline-shim)
Polyfill for stream.pipeline in node versions < v10
node v10.0.0 added support for a built-in `stream.pipeline`:
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](https://github.com/es-shims/api)
interface. It works in an ES5-supported environment and complies with the
[spec](http://www.ecma-international.org/ecma-262/6.0/).## Installation
```shell
npm install stream.pipeline-shim
```_Additionally for Typescript:_
```shell
npm install -D @types/node
```## Usage
### Direct
```js
const pipeline = require('stream.pipeline-shim');
// Use `pipeline` just like the built-in method on `stream`
```_Typescript:_
```ts
import pipeline from 'stream.pipeline-shim';
// Use `pipeline` just like the built-in method on `stream`
```### Shim
```js
require('stream.pipeline-shim/shim')();
// `stream.pipeline` is now defined
const stream = require('stream');
// Use `stream.pipeline`
```or:
```js
require('stream.pipeline-shim/auto');
// `stream.pipeline` is now defined
const stream = require('stream');
// Use `stream.pipeline`
```_Typescript:_
```js
import finishedShim from 'stream.pipeline-shim/shim';
finishedShim();
// `stream.pipeline` is now defined
import stream from 'stream';
// Use `stream.pipeline`
```or:
```js
import 'stream.pipeline-shim/auto';
// `stream.pipeline` is now defined
import stream from 'stream';
// Use `stream.pipeline`
```## License
Copyright (c) 2018-2019 Piotr Roszatycki
Copyright Node.js contributors. All rights reserved.
Copyright (c) 2014 Mathias Buus
[MIT](https://opensource.org/licenses/MIT)