Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

detour-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detour-stream

Use boolean expressions/functions to conditionally attach a stream as a detour or an alternative destination stream.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-69.23%
Maintainers
1
Weekly downloads
 
Created
Source

detour-stream

Use boolean expressions/functions to conditionally attach a stream as a detour or an alternative destination stream.

This module is inspired by gulp-if. The difference is that this module is not created for gulp.

Following the above diagram, if bool is unsatisfied, then data from stream A will pass through to Stream D.

Otherwise, data will pipe to Stream B whenever bool is satisfied.

If branch is true, then data will not be piped back to Stream D. This is useful when emulating if/else with streams.

API

detour(bool, stream [, branch])

detour will pipe data to stream appropriately whenever bool is satisfied.

Parameters

bool

Type: boolean, or function

If a function is given, then the function is passed a data chunk. The function should return a boolean.

stream

Stream for detour-stream to pipe data into whenever bool satisfies.

branch

Type: boolean

Default: false

branch controls the flow behavior of whether detour-stream should pipe stream back to the main stream (i.e. detour stream).

If true, then gulp-if will not pipe stream back to the main stream. This emulates if/else stream flow.

License

MIT.

FAQs

Package last updated on 18 Feb 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc