npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

passthrough-pair

1.0.0

@mafintosh

npmHomeRepoSnykSocket
Downloads:433
$ npm install passthrough-pair
DailyWeeklyMonthlyYearly

passthrough-pair

Two duplex streams that are eachothers passthrough

npm install passthrough-pair

Usage

const pair = require('passthrough-pair')

const [a, b] = pair()

a.write('hello')

b.on('data', function (data) {
  // hello
  b.write('echo: ' + data)
})

a.on('data', function (data) {
  // echo: hello
})

Mostly useful for testing flows

License

Apache-2.0