Socket
Socket
Sign inDemoInstall

to-through

Package Overview
Dependencies
4
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    to-through

Wrap a Readable stream in a Transform stream.


Version published
Weekly downloads
1.8M
increased by6.23%
Maintainers
2
Install size
62.7 kB
Created
Weekly downloads
 

Changelog

Source

3.0.0 (2022-09-07)

⚠ BREAKING CHANGES

  • Switch to streamx (#9)
  • Upgrade scaffold, dropping node <10 support (#8)

Features

Miscellaneous Chores

  • Upgrade scaffold, dropping node <10 support (#8) (f095480)

Readme

Source

to-through

NPM version Downloads Build Status Coveralls Status

Wrap a Readable stream in a Transform stream.

Usage

var { Readable } = require('streamx');
var concat = require('concat-stream');
var toThrough = require('to-through');

var readable = Readable.from([' ', 'hello', ' ', 'world']);

// Can be used as a Readable or Transform
var maybeTransform = toThrough(readable);

Readable.from(['hi', ' ', 'there', ','])
  .pipe(maybeTransform)
  .pipe(
    concat(function (result) {
      // result === 'hi there, hello world'
    })
  );

API

toThrough(readableStream)

Takes a Readable stream as the only argument and returns a Transform stream wrapper. Any data piped into the Transform stream is piped passed along before any data from the wrapped Readable is injected into the stream.

License

MIT

Keywords

FAQs

Last updated on 07 Sep 2022

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