@libp2p/utils 4.0.5-d5ef1c91 → 4.0.6-051154dd
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 +5 -35
- package/dist/src/index.d.ts +20 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +20 -0
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +21 -0
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# @libp2p/utils <!-- 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,22 +5,13 @@
|
|
|
7
5
|
|
|
8
6
|
> Package to aggregate shared logic and dependencies for the libp2p ecosystem
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- [Install](#install)
|
|
13
|
-
- [Browser `<script>` tag](#browser-script-tag)
|
|
14
|
-
- [Usage](#usage)
|
|
15
|
-
- [API Docs](#api-docs)
|
|
16
|
-
- [License](#license)
|
|
17
|
-
- [Contribution](#contribution)
|
|
18
|
-
|
|
19
|
-
## Install
|
|
8
|
+
# Install
|
|
20
9
|
|
|
21
10
|
```console
|
|
22
11
|
$ npm i @libp2p/utils
|
|
23
12
|
```
|
|
24
13
|
|
|
25
|
-
|
|
14
|
+
## Browser `<script>` tag
|
|
26
15
|
|
|
27
16
|
Loading this module through a script tag will make it's exports available as `Libp2pUtils` in the global namespace.
|
|
28
17
|
|
|
@@ -30,36 +19,17 @@ Loading this module through a script tag will make it's exports available as `Li
|
|
|
30
19
|
<script src="https://unpkg.com/@libp2p/utils/dist/index.min.js"></script>
|
|
31
20
|
```
|
|
32
21
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
36
|
-
- Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc.
|
|
37
|
-
|
|
38
|
-
These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
|
|
39
|
-
|
|
40
|
-
## Usage
|
|
41
|
-
|
|
42
|
-
Each function should be imported directly.
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
|
|
46
|
-
|
|
47
|
-
const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
You can check the [API docs](https://libp2p.github.io/js-libp2p-utils).
|
|
51
|
-
|
|
52
|
-
## API Docs
|
|
22
|
+
# API Docs
|
|
53
23
|
|
|
54
24
|
- <https://libp2p.github.io/js-libp2p/modules/_libp2p_utils.html>
|
|
55
25
|
|
|
56
|
-
|
|
26
|
+
# License
|
|
57
27
|
|
|
58
28
|
Licensed under either of
|
|
59
29
|
|
|
60
30
|
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
61
31
|
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
62
32
|
|
|
63
|
-
|
|
33
|
+
# Contribution
|
|
64
34
|
|
|
65
35
|
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,2 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* The libp2p ecosystem has lots of repos with it comes several problems like:
|
|
5
|
+
*
|
|
6
|
+
* - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
7
|
+
* - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc.
|
|
8
|
+
*
|
|
9
|
+
* These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* Each function should be imported directly.
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
|
|
17
|
+
*
|
|
18
|
+
* const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
1
21
|
export {};
|
|
2
22
|
//# sourceMappingURL=index.d.ts.map
|
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,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* The libp2p ecosystem has lots of repos with it comes several problems like:
|
|
5
|
+
*
|
|
6
|
+
* - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
7
|
+
* - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc.
|
|
8
|
+
*
|
|
9
|
+
* These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* Each function should be imported directly.
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
|
|
17
|
+
*
|
|
18
|
+
* const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
1
21
|
export {};
|
|
2
22
|
//# sourceMappingURL=index.js.map
|
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,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/utils",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6-051154dd",
|
|
4
4
|
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/utils#readme",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@chainsafe/is-ip": "^2.0.2",
|
|
90
|
-
"@libp2p/interface": "0.1.
|
|
91
|
-
"@libp2p/logger": "3.0.
|
|
90
|
+
"@libp2p/interface": "0.1.5-051154dd",
|
|
91
|
+
"@libp2p/logger": "3.0.5-051154dd",
|
|
92
92
|
"@multiformats/multiaddr": "^12.1.5",
|
|
93
93
|
"@multiformats/multiaddr-matcher": "^1.0.1",
|
|
94
94
|
"is-loopback-addr": "^2.0.1",
|
package/src/index.ts
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* The libp2p ecosystem has lots of repos with it comes several problems like:
|
|
5
|
+
*
|
|
6
|
+
* - Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
7
|
+
* - Dependencies management - it's really easy with so many repos for dependencies to go out of control, they become outdated, different repos use different modules to do the same thing (like merging defaults options), browser bundles ends up with multiple versions of the same package, bumping versions is cumbersome to do because we need to go through several repos, etc.
|
|
8
|
+
*
|
|
9
|
+
* These problems are the motivation for this package, having shared logic in this package avoids creating cyclic dependencies, centralizes common use modules/functions (exactly like aegir does for the tooling), semantic versioning for 3rd party dependencies is handled in one single place (a good example is going from streams 2 to 3) and maintainers should only care about having `libp2p-utils` updated.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* Each function should be imported directly.
|
|
14
|
+
*
|
|
15
|
+
* ```js
|
|
16
|
+
* import ipAndPortToMultiaddr from '@libp2p/utils/ip-port-to-multiaddr'
|
|
17
|
+
*
|
|
18
|
+
* const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
|
|
1
22
|
export {}
|