@libp2p/utils 7.0.8 → 7.0.9-7fff925bf
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 +16 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +4 -4
- package/package.json +5 -5
- package/dist/typedoc-urls.json +0 -124
package/README.md
CHANGED
|
@@ -24,7 +24,22 @@ repo and examine the changes made.
|
|
|
24
24
|
|
|
25
25
|
-->
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
The libp2p ecosystem has lots of repos with it comes several problems like:
|
|
28
|
+
|
|
29
|
+
- Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
|
|
30
|
+
- 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.
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
|
|
36
|
+
Each function should be imported directly.
|
|
37
|
+
|
|
38
|
+
```TypeScript
|
|
39
|
+
import { ipPortToMultiaddr } from '@libp2p/utils'
|
|
40
|
+
|
|
41
|
+
const ma = ipPortToMultiaddr('127.0.0.1', 9000)
|
|
42
|
+
```
|
|
28
43
|
|
|
29
44
|
# Install
|
|
30
45
|
|