Create handshakes for binary protocols with iterable streams
$ npm i it-handshake
<script> tagLoading this module through a script tag will make it's exports available as ItHandshake in the global namespace.
<script src="https://unpkg.com/it-handshake/dist/index.min.js"></script>
handshake(duplex)duplex: DuplexIterable A duplex iterable streamReturns a new handshake instance that produces BufferList objects.
shake.write(message)message: String|Buffer|BufferListshake.read()Returns the next BufferList message in the stream.
shake.rest()Ends the writer. This is necessary for continuing to pipe data through shake.stream
shake.streamThe duplex iterable stream to be used once the handshake is complete.
shake.readerThe underyling it-reader used by shake.read(). While direct usage of the reader is typically unnecessary, it is available for advanced usage.
shake.writerThe underyling writer, it-pushable, used by shake.write(). While direct usage of the writer is typically unnecessary, it is available for advanced usage.
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.