JSPM

  • Created
  • Published
  • Downloads 19147
  • Score
    100M100P100Q133811F
  • License MIT

JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport spec

Package Exports

  • libp2p-websockets

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 (libp2p-websockets) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

js-libp2p-websockets

Coverage Status Travis CI Circle CI Dependency Status js-standard-style

Sauce Test Status

JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport interface

Description

libp2p-websockets is the WebSockets implementation compatible with libp2p.

Note: This module uses pull-streams for all stream based interfaces.

Example

TODO

Installation

npm

> npm i libp2p-websockets

This module uses pull-streams

We expose a streaming interface based on pull-streams, rather then on the Node.js core streams implementation (aka Node.js streams). pull-streams offers us a better mechanism for error handling and flow control guarantees. If you would like to know more about why we did this, see the discussion at this issue.

You can learn more about pull-streams at:

Converting pull-streams to Node.js Streams

If you are a Node.js streams user, you can convert a pull-stream to a Node.js stream using the module pull-stream-to-stream, giving you an instance of a Node.js stream that is linked to the pull-stream. For example:

const pullToStream = require('pull-stream-to-stream')

const nodeStreamInstance = pullToStream(pullStreamInstance)
// nodeStreamInstance is an instance of a Node.js Stream

To learn more about this utility, visit https://pull-stream.github.io/#pull-stream-to-stream.

API