@lambrioanpm/dolore-earum-explicabo
v1.0.0
Published
@lambrioanpm/dolore-earum-explicabo ==============
Downloads
3
Maintainers
Keywords
Readme
@lambrioanpm/dolore-earum-explicabo
Make a full duplex stream with 2 Duplex endpoints.
Install:
npm install @lambrioanpm/dolore-earum-explicabo
const DuplexPair = require('@lambrioanpm/dolore-earum-explicabo');
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