Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
invert-stream
Advanced tools
Readme
Create a pair of streams (A, B) such that A.write(X) -> B.emit('data', X)
and B.write(X) -> A.emit('data', X)
var invert = require('invert-stream')
var inverted = invert()
in_steam.pipe(inverted.other).pipe(out_stream)
inverted.write(data_for_outstream)
inverted.on('data', data_from_in_stream)
## why ?
this is useful for a couple of things.
* testing streams based stuff
* making flexible duplex stream apis
an `invert-stream` pair is like a tcp connection,
but in-process and synchronous. It's way easier to test
edge cases related to event order if you stuff works sync.
Also, it's useful making duplex streams, or multiple streams into one.
### Example
```js
var spawn = require('child_process').spawn
var invert = require('invert-stream')
var ch = spawn(cmd, args)
var inverted = invert()
ch.stdout.pipe(inverted.other).pipe(ch.sdin)
//now, we have just ONE stream: inverted
//write to che ch's stdin
inverted.write(data)
//read from ch's stdout
inverted.on('data', ...)
MIT
FAQs
Create a pair of streams (A, B) such that `A.write(X) -> B.emit('data', X)` and `B.write(X) -> A.emit('data', X)`
The npm package invert-stream receives a total of 592 weekly downloads. As such, invert-stream popularity was classified as not popular.
We found that invert-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.