Commit iniziale
This commit is contained in:
39
node_modules/native-duplexpair/README.md
generated
vendored
Normal file
39
node_modules/native-duplexpair/README.md
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
duplexpair
|
||||
==============
|
||||
|
||||
[](https://npmjs.org/package/duplexpair)
|
||||
[](https://npmjs.org/package/duplexpair)
|
||||
[](https://travis-ci.org/addaleax/duplexpair?branch=master)
|
||||
[](https://coveralls.io/r/addaleax/duplexpair?branch=master)
|
||||
[](https://david-dm.org/addaleax/duplexpair)
|
||||
|
||||
Make a full duplex stream with 2 Duplex endpoints.
|
||||
|
||||
**Note:**
|
||||
|
||||
This is a fork of `duplexpair`, changed to use the "native" `Duplex` stream that is part
|
||||
of Node.JS instead of the version from the `readable-stream` package.
|
||||
|
||||
Install:
|
||||
`npm install native-duplexpair`
|
||||
|
||||
```js
|
||||
const DuplexPair = require('native-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
|
||||
Reference in New Issue
Block a user