Package Exports
- duplexpair
- duplexpair/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (duplexpair) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
duplexpair
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