@libp2p/multistream-select 4.0.4 → 4.0.5-dfbe0cc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -35
- package/dist/src/index.d.ts +21 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +21 -0
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +22 -0
- package/dist/typedoc-urls.json +0 -14
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# @libp2p/multistream-select <!-- omit in toc -->
|
|
2
|
-
|
|
3
1
|
[](http://libp2p.io/)
|
|
4
2
|
[](https://discuss.libp2p.io)
|
|
5
3
|
[](https://codecov.io/gh/libp2p/js-libp2p)
|
|
@@ -7,38 +5,11 @@
|
|
|
7
5
|
|
|
8
6
|
> JavaScript implementation of multistream-select
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- [Install](#install)
|
|
13
|
-
- [Browser `<script>` tag](#browser-script-tag)
|
|
14
|
-
- [Background](#background)
|
|
15
|
-
- [What is `multistream-select`?](#what-is-multistream-select)
|
|
16
|
-
- [Select a protocol flow](#select-a-protocol-flow)
|
|
17
|
-
- [API Docs](#api-docs)
|
|
18
|
-
- [License](#license)
|
|
19
|
-
- [Contribution](#contribution)
|
|
20
|
-
|
|
21
|
-
## Install
|
|
22
|
-
|
|
23
|
-
```console
|
|
24
|
-
$ npm i @libp2p/multistream-select
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Browser `<script>` tag
|
|
28
|
-
|
|
29
|
-
Loading this module through a script tag will make it's exports available as `Libp2pMultistreamSelect` in the global namespace.
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<script src="https://unpkg.com/@libp2p/multistream-select/dist/index.min.js"></script>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Background
|
|
36
|
-
|
|
37
|
-
### What is `multistream-select`?
|
|
8
|
+
# About
|
|
38
9
|
|
|
39
|
-
|
|
10
|
+
multistream-select is protocol multiplexing per connection/stream. [Full spec here](https://github.com/multiformats/multistream-select)
|
|
40
11
|
|
|
41
|
-
|
|
12
|
+
## Select a protocol flow
|
|
42
13
|
|
|
43
14
|
The caller will send "interactive" messages, expecting for some acknowledgement from the callee, which will "select" the handler for the desired and supported protocol:
|
|
44
15
|
|
|
@@ -54,17 +25,31 @@ The caller will send "interactive" messages, expecting for some acknowledgement
|
|
|
54
25
|
> <dht-message>
|
|
55
26
|
```
|
|
56
27
|
|
|
57
|
-
|
|
28
|
+
# Install
|
|
29
|
+
|
|
30
|
+
```console
|
|
31
|
+
$ npm i @libp2p/multistream-select
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Browser `<script>` tag
|
|
35
|
+
|
|
36
|
+
Loading this module through a script tag will make it's exports available as `Libp2pMultistreamSelect` in the global namespace.
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script src="https://unpkg.com/@libp2p/multistream-select/dist/index.min.js"></script>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
# API Docs
|
|
58
43
|
|
|
59
44
|
- <https://libp2p.github.io/js-libp2p/modules/_libp2p_multistream_select.html>
|
|
60
45
|
|
|
61
|
-
|
|
46
|
+
# License
|
|
62
47
|
|
|
63
48
|
Licensed under either of
|
|
64
49
|
|
|
65
50
|
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
66
51
|
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
# Contribution
|
|
69
54
|
|
|
70
55
|
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.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* multistream-select is protocol multiplexing per connection/stream. [Full spec here](https://github.com/multiformats/multistream-select)
|
|
5
|
+
*
|
|
6
|
+
* ## Select a protocol flow
|
|
7
|
+
*
|
|
8
|
+
* The caller will send "interactive" messages, expecting for some acknowledgement from the callee, which will "select" the handler for the desired and supported protocol:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* < /multistream-select/0.3.0 # i speak multistream-select/0.3.0
|
|
12
|
+
* > /multistream-select/0.3.0 # ok, let's speak multistream-select/0.3.0
|
|
13
|
+
* > /ipfs-dht/0.2.3 # i want to speak ipfs-dht/0.2.3
|
|
14
|
+
* < na # ipfs-dht/0.2.3 is not available
|
|
15
|
+
* > /ipfs-dht/0.1.9 # What about ipfs-dht/0.1.9 ?
|
|
16
|
+
* < /ipfs-dht/0.1.9 # ok let's speak ipfs-dht/0.1.9 -- in a sense acts as an ACK
|
|
17
|
+
* > <dht-message>
|
|
18
|
+
* > <dht-message>
|
|
19
|
+
* > <dht-message>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
1
22
|
import { PROTOCOL_ID } from './constants.js';
|
|
2
23
|
import type { AbortOptions } from '@libp2p/interface';
|
|
3
24
|
import type { Duplex, Source } from 'it-stream-types';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,WAAW,cAAc,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CA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,qBAAsB,SAAQ,YAAY;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* multistream-select is protocol multiplexing per connection/stream. [Full spec here](https://github.com/multiformats/multistream-select)
|
|
5
|
+
*
|
|
6
|
+
* ## Select a protocol flow
|
|
7
|
+
*
|
|
8
|
+
* The caller will send "interactive" messages, expecting for some acknowledgement from the callee, which will "select" the handler for the desired and supported protocol:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* < /multistream-select/0.3.0 # i speak multistream-select/0.3.0
|
|
12
|
+
* > /multistream-select/0.3.0 # ok, let's speak multistream-select/0.3.0
|
|
13
|
+
* > /ipfs-dht/0.2.3 # i want to speak ipfs-dht/0.2.3
|
|
14
|
+
* < na # ipfs-dht/0.2.3 is not available
|
|
15
|
+
* > /ipfs-dht/0.1.9 # What about ipfs-dht/0.1.9 ?
|
|
16
|
+
* < /ipfs-dht/0.1.9 # ok let's speak ipfs-dht/0.1.9 -- in a sense acts as an ACK
|
|
17
|
+
* > <dht-message>
|
|
18
|
+
* > <dht-message>
|
|
19
|
+
* > <dht-message>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
1
22
|
import { PROTOCOL_ID } from './constants.js';
|
|
2
23
|
export { PROTOCOL_ID };
|
|
3
24
|
export { select, lazySelect } from './select.js';
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,EAAE,WAAW,EAAE,CAAA;AAmBtB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,EAAE,WAAW,EAAE,CAAA;AAmBtB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/multistream-select",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5-dfbe0cc0",
|
|
4
4
|
"description": "JavaScript implementation of multistream-select",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/multistream-select#readme",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"test:electron-main": "aegir test -t electron-main"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@libp2p/interface": "
|
|
57
|
-
"@libp2p/logger": "
|
|
56
|
+
"@libp2p/interface": "0.1.5-dfbe0cc0",
|
|
57
|
+
"@libp2p/logger": "3.0.5-dfbe0cc0",
|
|
58
58
|
"abortable-iterator": "^5.0.1",
|
|
59
59
|
"it-first": "^3.0.1",
|
|
60
60
|
"it-handshake": "^4.1.3",
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* multistream-select is protocol multiplexing per connection/stream. [Full spec here](https://github.com/multiformats/multistream-select)
|
|
5
|
+
*
|
|
6
|
+
* ## Select a protocol flow
|
|
7
|
+
*
|
|
8
|
+
* The caller will send "interactive" messages, expecting for some acknowledgement from the callee, which will "select" the handler for the desired and supported protocol:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* < /multistream-select/0.3.0 # i speak multistream-select/0.3.0
|
|
12
|
+
* > /multistream-select/0.3.0 # ok, let's speak multistream-select/0.3.0
|
|
13
|
+
* > /ipfs-dht/0.2.3 # i want to speak ipfs-dht/0.2.3
|
|
14
|
+
* < na # ipfs-dht/0.2.3 is not available
|
|
15
|
+
* > /ipfs-dht/0.1.9 # What about ipfs-dht/0.1.9 ?
|
|
16
|
+
* < /ipfs-dht/0.1.9 # ok let's speak ipfs-dht/0.1.9 -- in a sense acts as an ACK
|
|
17
|
+
* > <dht-message>
|
|
18
|
+
* > <dht-message>
|
|
19
|
+
* > <dht-message>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
|
|
1
23
|
import { PROTOCOL_ID } from './constants.js'
|
|
2
24
|
import type { AbortOptions } from '@libp2p/interface'
|
|
3
25
|
import type { Duplex, Source } from 'it-stream-types'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"ByteArrayInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ByteArrayInit.html",
|
|
3
|
-
".:ByteArrayInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ByteArrayInit.html",
|
|
4
|
-
"ByteListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ByteListInit.html",
|
|
5
|
-
".:ByteListInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ByteListInit.html",
|
|
6
|
-
"MultistreamSelectInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.MultistreamSelectInit.html",
|
|
7
|
-
".:MultistreamSelectInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.MultistreamSelectInit.html",
|
|
8
|
-
"ProtocolStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ProtocolStream.html",
|
|
9
|
-
".:ProtocolStream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_multistream_select.ProtocolStream.html",
|
|
10
|
-
"PROTOCOL_ID": "https://libp2p.github.io/js-libp2p/variables/_libp2p_multistream_select.PROTOCOL_ID.html",
|
|
11
|
-
"handle": "https://libp2p.github.io/js-libp2p/functions/_libp2p_multistream_select.handle.html",
|
|
12
|
-
"lazySelect": "https://libp2p.github.io/js-libp2p/functions/_libp2p_multistream_select.lazySelect.html",
|
|
13
|
-
"select": "https://libp2p.github.io/js-libp2p/functions/_libp2p_multistream_select.select.html"
|
|
14
|
-
}
|