mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-04-25 09:22:28 +00:00
docs: update and polish README
This commit is contained in:
parent
f16e14ab20
commit
cccf269918
48
README.md
48
README.md
@ -11,8 +11,8 @@
|
|||||||

|

|
||||||

|

|
||||||
|
|
||||||

|
[](https://github.com/libp2p/interface-transport)
|
||||||

|
[](https://github.com/libp2p/interface-connection)
|
||||||
|
|
||||||
> JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport interface
|
> JavaScript implementation of the WebSockets module that libp2p uses and that implements the interface-transport interface
|
||||||
|
|
||||||
@ -20,15 +20,9 @@
|
|||||||
|
|
||||||
`libp2p-websockets` is the WebSockets implementation compatible with libp2p.
|
`libp2p-websockets` is the WebSockets implementation compatible with libp2p.
|
||||||
|
|
||||||
**Note:** This module uses [pull-streams](https://pull-stream.github.io) for all stream based interfaces.
|
## Usage
|
||||||
|
|
||||||
## Example
|
## Install
|
||||||
|
|
||||||
```
|
|
||||||
TODO
|
|
||||||
```
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### npm
|
### npm
|
||||||
|
|
||||||
@ -36,32 +30,18 @@ TODO
|
|||||||
> npm i libp2p-websockets
|
> npm i libp2p-websockets
|
||||||
```
|
```
|
||||||
|
|
||||||
### This module uses `pull-streams`
|
### Example
|
||||||
|
|
||||||
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](https://github.com/ipfs/js-ipfs/issues/362).
|
|
||||||
|
|
||||||
You can learn more about pull-streams at:
|
|
||||||
|
|
||||||
- [The history of Node.js streams, nodebp April 2014](https://www.youtube.com/watch?v=g5ewQEuXjsQ)
|
|
||||||
- [The history of streams, 2016](http://dominictarr.com/post/145135293917/history-of-streams)
|
|
||||||
- [pull-streams, the simple streaming primitive](http://dominictarr.com/post/149248845122/pull-streams-pull-streams-are-a-very-simple)
|
|
||||||
- [pull-streams documentation](https://pull-stream.github.io/)
|
|
||||||
|
|
||||||
#### 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`](https://github.com/pull-stream/pull-stream-to-stream), giving you an instance of a Node.js stream that is linked to the pull-stream. For example:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const pullToStream = require('pull-stream-to-stream')
|
|
||||||
|
|
||||||
const nodeStreamInstance = pullToStream(pullStreamInstance)
|
|
||||||
// nodeStreamInstance is an instance of a Node.js Stream
|
|
||||||
```
|
```
|
||||||
|
TODO
|
||||||
To learn more about this utility, visit https://pull-stream.github.io/#pull-stream-to-stream.
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
[](https://github.com/libp2p/interface-transport)
|
### Transport
|
||||||
|
|
||||||
|
[](https://github.com/libp2p/interface-transport)
|
||||||
|
|
||||||
|
### Connection
|
||||||
|
|
||||||
|
[](https://github.com/libp2p/interface-connection)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user