Package detail

it-handshake

jacobheun71.3kApache-2.0 OR MIT4.1.3

Create handshakes for binary protocols with iterable streams

async, handshake, iterable, iterator

readme

it-handshake

codecov CI

Create handshakes for binary protocols with iterable streams

Table of contents

Install

$ npm i it-handshake

Browser <script> tag

Loading 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>

API

handshake(duplex)

Returns a new handshake instance that produces BufferList objects.

shake.write(message)

  • message: String|Buffer|BufferList

shake.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.stream

The duplex iterable stream to be used once the handshake is complete.

shake.reader

The underyling it-reader used by shake.read(). While direct usage of the reader is typically unnecessary, it is available for advanced usage.

shake.writer

The underyling writer, it-pushable, used by shake.write(). While direct usage of the writer is typically unnecessary, it is available for advanced usage.

Related

API Docs

License

Licensed under either of

Contribution

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.

changelog

4.1.3 (2023-04-18)

Dependencies

4.1.2 (2022-08-11)

Bug Fixes

4.1.1 (2022-08-10)

Bug Fixes

  • support streams with different sink and source types (#28) (cc1bac4)

4.1.0 (2022-08-03)

Features

4.0.1 (2022-07-31)

Trivial Changes

  • deps: bump it-reader from 5.0.2 to 6.0.1 (#24) (596259e)

4.0.0 (2022-06-15)

⚠ BREAKING CHANGES

  • it-pushable types are exported as part of the public api and the default type isn't generic any more

Trivial Changes

3.0.1 (2022-02-16)

Bug Fixes

3.0.0 (2022-01-14)

⚠ BREAKING CHANGES

  • switch to named exports, ESM only

Features

Trivial Changes

2.0.0 (2021-04-08)

1.0.2 (2020-08-12)

Bug Fixes

  • unhandled promise rejection when async work done after handshake (#2) (61db942)

1.0.1 (2019-10-30)

1.0.0 (2019-09-26)

Features