Socket
Socket
Sign inDemoInstall

stream-pipe

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stream-pipe

add stream.pipeFrom


Version published
Maintainers
1
Install size
57.3 kB
Created

Changelog

Source

1.0.4 (2021-08-06)

🛠 Build System

  • update pack ignore .ts (11341a9)

🔖 Miscellaneous

Readme

Source

stream-pipe

add stream.pipeFrom

API

pipe

same as readable.pipe(destination, options)

import pipe from 'stream-pipe';

pipe(srcStream, destStream) // => destStream with pipeFrom = srcStream

createReadStream

same as fs.createReadStream(path, options)

import createReadStream, { ReadStream } from 'stream-pipe/fs';

demo

import * as through2 from 'through2';
import createReadStream from 'stream-pipe/fs';

let file = '../.gitignore';

createReadStream(file).pipe(through2.obj(function (chunk, enc, cb)
{
	console.log(this.pipeFrom.path);
	console.log(this.pipeFrom.bytesRead);

	this.push(chunk);
	cb();
}));

Keywords

FAQs

Last updated on 06 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc