Go to file
Pavel Murygin cacef402ee fix types
2021-04-09 18:55:39 +03:00
.github/workflows feat: add types (#16) 2021-04-08 11:52:55 +02:00
src fix types 2021-04-09 18:55:39 +03:00
test bump dependencies 2021-04-09 18:12:25 +03:00
.gitignore feat: ip port to multiaddr (#1) 2019-09-23 17:39:32 +02:00
API.md feat: address sorter (#13) 2020-11-16 15:03:20 +01:00
CHANGELOG.md chore: release version v0.3.0 2021-04-08 11:55:53 +02:00
LICENSE feat: ip port to multiaddr (#1) 2019-09-23 17:39:32 +02:00
package.json fix types 2021-04-09 18:55:39 +03:00
README.md chore: create API doc 2020-10-08 09:33:00 +02:00
tsconfig.json feat: add types (#16) 2021-04-08 11:52:55 +02:00

js-libp2p-utils

Discourse posts Dependency Status js-standard-style

This package serves as a central repository for shared logic and dependencies for all libp2p packages, using libp2p-utils helps to easily re-use small scoped blocks of logic across all libp2p modules and also as a dependency proxy (think aegir for domain logic dependencies).

The libp2p ecosystem has lots of repos with it comes several problems like:

  • Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.
  • 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.

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.

Lead Maintainer

Vasco Santos

Install

$ npm install --save libp2p-utils

Usage

Each function should be imported directly.

const ipAndPortToMultiaddr = require('libp2p-utils/src/ip-port-to-multiaddr')

const ma = ipAndPortToMultiaddr('127.0.0.1', 9000)

You can check the API docs.

Contribute

Contributions welcome. Please check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

License

MIT © Protocol Labs Inc.