{"name":"@libp2p/utils","version":"4.0.0-e66f4891","license":"Apache-2.0 OR MIT","_id":"@libp2p/utils@4.0.0-e66f4891","homepage":"https://github.com/libp2p/js-libp2p/tree/master/packages/utils#readme","bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"dist":{"shasum":"e97c52ac77865c41282ccd8cb9a54811710b9e51","tarball":"http://registry-npm.ywwl.com/@libp2p/utils/download/@libp2p/utils-4.0.0-e66f4891.tgz","fileCount":39,"integrity":"sha512-D2LMOk5hotckudsiCnaAW0jJENHY8o+UMMVzpGrLpyH+Gey5SB0Yp/ZHfPph5I4Zjw18tI89O/S4tEURhpUn9Q==","signatures":[{"sig":"MEUCIQDYlK+M7+I/rbQ6+pdTXcUlYayxQBnMl4e7khNZMlXuigIgGCDdiC4ZaPwYY21fv7jt+fsUWmpOFSjwULP03miiow0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":28925,"size":9130,"noattachment":false,"key":"/@libp2p/utils/-/@libp2p/utils-4.0.0-e66f4891.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","import":"./dist/src/index.js"},"./address-sort":{"types":"./dist/src/address-sort.d.ts","import":"./dist/src/address-sort.js"},"./array-equals":{"types":"./dist/src/array-equals.d.ts","import":"./dist/src/array-equals.js"},"./stream-to-ma-conn":{"types":"./dist/src/stream-to-ma-conn.d.ts","import":"./dist/src/stream-to-ma-conn.js"},"./ip-port-to-multiaddr":{"types":"./dist/src/ip-port-to-multiaddr.d.ts","import":"./dist/src/ip-port-to-multiaddr.js"},"./multiaddr/is-private":{"types":"./dist/src/multiaddr/is-private.d.ts","import":"./dist/src/multiaddr/is-private.js"},"./multiaddr/is-loopback":{"types":"./dist/src/multiaddr/is-loopback.d.ts","import":"./dist/src/multiaddr/is-loopback.js"}},"gitHead":"e66f48913128075c77692040b05df12c7f2e4db6","scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","test:electron-main":"aegir test -t electron-main","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"npm-service-account-libp2p","email":"npm-service-account+libp2p@protocol.ai"},"repository":{"url":"git+https://github.com/libp2p/js-libp2p.git","type":"git"},"_npmVersion":"9.8.1","description":"Package to aggregate shared logic and dependencies for the libp2p ecosystem","directories":{},"_nodeVersion":"18.17.0","dependencies":{"private-ip":"^3.0.0","@libp2p/logger":"3.0.0-e66f4891","uint8arraylist":"^2.4.3","it-stream-types":"^2.0.1","is-loopback-addr":"^2.0.1","@libp2p/interface":"0.1.0-e66f4891","@achingbrain/ip-address":"^8.1.0","@multiformats/multiaddr":"^12.1.3"},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^40.0.1","it-all":"^3.0.1","it-pair":"^2.0.6","it-pipe":"^3.0.1","uint8arrays":"^4.0.4"},"_npmOperationalInternal":{"tmp":"tmp/utils_4.0.0-e66f4891_1690869903607_0.39458441864370664","host":"s3://npm-registry-packages"},"readme":"# @libp2p/utils\n\n[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)\n[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)\n[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=main\\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amain)\n\n> Package to aggregate shared logic and dependencies for the libp2p ecosystem\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nThe libp2p ecosystem has lots of repos with it comes several problems like:\n\n- Domain logic dedupe - all modules shared a lot of logic like validation, streams handling, etc.\n- 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.\n\nThese 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.\n\n## Example\n\nEach function should be imported directly.\n\n```TypeScript\nimport { ipPortToMultiaddr } from '@libp2p/utils/ip-port-to-multiaddr'\n\nconst ma = ipPortToMultiaddr('127.0.0.1', 9000)\n```\n\n# Install\n\n```console\n$ npm i @libp2p/utils\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `Libp2pUtils` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/@libp2p/utils/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://libp2p.github.io/js-libp2p/modules/_libp2p_utils.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p/blob/main/packages/utils/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p/blob/main/packages/utils/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless 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.\n","publish_time":1690869903849,"maintainers":[{"name":"jacobheun","email":"jacobheun@gmail.com"},{"name":"npm-service-account-libp2p","email":"npm-service-account+libp2p@ipfs.tech"},{"name":"alanshaw","email":"alan138@gmail.com"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"daviddias","email":"mail@daviddias.me"}],"_cnpm_publish_time":1690869903849,"dist-tags":{"latest":"7.4.5","next":"7.4.5-fab409544"}}