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

Made by Antonio Ramirez

duplex-through

1.0.2

@mafintosh

npmHomeRepoSnykSocket
Downloads:564
$ npm install duplex-through
DailyWeeklyMonthlyYearly

duplex-through

Make two Duplex streamx streams that are passing through to each other.

Write to one, it push data to the other one.

npm install duplex-through

Useful for testing server/client flows

Usage

const duplexThrough = require('duplex-through')

const [a, b] = duplexThrough()

a.write('hello')
b.on('data', function (data) {
  // hello
})

License

MIT