Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 0025407

Browse files
committed
Standardize Readme
Also did some edits to the text here and there. Added a contribute section, too.
1 parent 1d1d091 commit 0025407

File tree

2 files changed

+45
-21
lines changed

2 files changed

+45
-21
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 David Dias
3+
Copyright (c) 2015-2016 David Dias
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+44-20
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,33 @@
1212

1313
> Node.js implementation of the TCP module that libp2p uses, which implements the [interface-connection](https://github.com/libp2p/interface-connection) interface for dial/listen.
1414
15-
## Description
16-
1715
`libp2p-tcp` in Node.js is a very thin shim that adds support for dialing to a `multiaddr`. This small shim will enable libp2p to use other different transports.
1816

1917
**Note:** This module uses [pull-streams](https://pull-stream.github.io) for all stream based interfaces.
2018

21-
## Example
19+
## Table of Contents
20+
21+
- [Install](#install)
22+
- [npm](#npm)
23+
- [Usage](#usage)
24+
- [Example](#example)
25+
- [This module uses `pull-streams`](#this-module-uses-pull-streams)
26+
- [Converting `pull-streams` to Node.js Streams](#converting-pull-streams-to-nodejs-streams)
27+
- [API](#api)
28+
- [Contribute](#contribute)
29+
- [License](#license)
30+
31+
## Install
32+
33+
### npm
34+
35+
```sh
36+
> npm i libp2p-tcp
37+
```
38+
39+
## Usage
40+
41+
### Example
2242

2343
```js
2444
const TCP = require('libp2p-tcp')
@@ -51,25 +71,17 @@ listener.listen(() => {
5171
})
5272
```
5373

54-
outputs
74+
Outputs:
5575

56-
```
76+
```sh
5777
listening
5878
new connection opened
5979
hello
6080
```
6181

62-
## Installation
82+
### This module uses `pull-streams`
6383

64-
### npm
65-
66-
```sh
67-
> npm i libp2p-tcp
68-
```
69-
70-
## This module uses `pull-streams`
71-
72-
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 what took us to make this migration, see the discussion at this [issue](https://github.com/ipfs/js-ipfs/issues/362).
84+
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).
7385

7486
You can learn more about pull-streams at:
7587

@@ -78,18 +90,18 @@ You can learn more about pull-streams at:
7890
- [pull-streams, the simple streaming primitive](http://dominictarr.com/post/149248845122/pull-streams-pull-streams-are-a-very-simple)
7991
- [pull-streams documentation](https://pull-stream.github.io/)
8092

81-
### Converting `pull-streams` to Node.js Streams
93+
#### Converting `pull-streams` to Node.js Streams
8294

83-
If you are a Node.js streams user, you can convert a pull-stream to 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. Example:
95+
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/dominictarr/pull-stream-to-stream), giving you an instance of a Node.js stream that is linked to the pull-stream. For example:
8496

85-
```
97+
```js
8698
const pullToStream = require('pull-stream-to-stream')
8799

88100
const nodeStreamInstance = pullToStream(pullStreamInstance)
89101
// nodeStreamInstance is an instance of a Node.js Stream
90102
```
91103

92-
To learn more about his utility, visit https://pull-stream.github.io/#pull-stream-to-stream
104+
To learn more about this utility, visit https://pull-stream.github.io/#pull-stream-to-stream.
93105

94106
## API
95107

@@ -102,6 +114,18 @@ To learn more about his utility, visit https://pull-stream.github.io/#pull-strea
102114

103115
Both for dialing and listening.
104116

117+
## Contribute
118+
119+
Contributions are welcome! The libp2p implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
120+
121+
- [Check out the existing issues](//github.com/libp2p/js-libp2p-tcp/issues).
122+
- **Perform code reviews**.
123+
- **Add tests**. There can never be enough tests.
124+
125+
Please be aware that all interactions related to libp2p are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).
126+
127+
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
128+
105129
## License
106130

107-
MIT
131+
[MIT](LICENSE) © 2015-2016 David Dias

0 commit comments

Comments
 (0)