duplexpair
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

duplexpair

NPM Version NPM Downloads Build Status Coverage Status Dependency Status

Make a full duplex stream with 2 Duplex endpoints.

Install: npm install duplexpair

const DuplexPair = require('duplexpair');

const { socket1, socket2 } = new DuplexPair();

socket1.write('Hi');
console.log(socket2.read());  // => <Buffer 48 69>

// Or, using options that are passed to the Duplex constructor:

const { socket1, socket2 } = new DuplexPair({ encoding: 'utf8' });

socket1.write('Hi');
console.log(socket2.read());  // => 'Hi'

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    25,891
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    25,891
  • 1.0.1
    6
  • 1.0.0
    0

Package Sidebar

Install

npm i duplexpair

Weekly Downloads

25,897

Version

1.0.2

License

MIT

Unpacked Size

8.64 kB

Total Files

8

Last publish

Collaborators

  • addaleax