{"name":"@multiformats/multiaddr","version":"11.0.0","description":"multiaddr implementation (binary + string representation of network addresses)","license":"Apache-2.0 OR MIT","homepage":"https://github.com/multiformats/js-multiaddr#readme","repository":{"type":"git","url":"git+https://github.com/multiformats/js-multiaddr.git"},"bugs":{"url":"https://github.com/multiformats/js-multiaddr/issues"},"keywords":["binary","multiaddr","string"],"engines":{"node":">=16.0.0","npm":">=7.0.0"},"type":"module","types":"./dist/src/index.d.ts","typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./convert":{"types":"./dist/src/convert.d.ts","import":"./dist/src/convert.js"},"./resolvers":{"types":"./dist/src/resolvers/index.d.ts","import":"./dist/src/resolvers/index.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","build":"aegir build","test":"aegir test -f","test:chrome":"aegir test -t browser","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","test:node":"aegir test -t node --cov","test:electron-main":"aegir test -t electron-main","release":"aegir release"},"dependencies":{"dns-over-http-resolver":"^2.1.0","err-code":"^3.0.1","is-ip":"^5.0.0","multiformats":"^9.4.5","uint8arrays":"^3.0.0","varint":"^6.0.0"},"devDependencies":{"@types/varint":"^6.0.0","aegir":"^37.4.5","sinon":"^14.0.0","util":"^0.12.3"},"browser":{"./dist/src/resolvers/dns.js":"./dist/src/resolvers/dns.browser.js"},"gitHead":"7efd9b62d52db2b9464ec32f606819e3598657e9","_id":"@multiformats/multiaddr@11.0.0","_nodeVersion":"16.17.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-NfOx/RF7TmGeCiQ5rmpvU7Ny7VKfmIG2jP2XSebTCv78vGuSRQ1YF+5UEKWft2Kjhtj1Xaq7dvgB9SeLp+BYSw==","shasum":"a00166476548ab375533c93b997d2912ee14e343","tarball":"http://registry-npm.ywwl.com/@multiformats/multiaddr/download/@multiformats/multiaddr-11.0.0.tgz","fileCount":43,"unpackedSize":123869,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDho8tZJ/pxpD8R09D7H9MMmDbGQufM1IIUPMkukeeI5wIhAOMcxg5fLluLppdCFct5Cg6kMv2U3/5pIn1+afAlFhAw"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKqMTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUiQ//X8gGYI2Q992DkZcrHHp19hQSo+jDaUKlow91Uj1uNehBAxrF\r\nvXxvb1VpJsK4Cq4vYJfRlGo1IK+dY6jMGEwlVoqUHu4YEOVIlBtbbhRcDPJY\r\nvwZLpXDVv2OLzsZJWgpwCoaTNSbeyS5Hedy4SE3CeSHLGLwbDnu9OaMf9ivx\r\nuLmNv4gTjmTclKzWs5frdvLc6je1NRBNctji3DqeDE2YG99EBkTBTiLnLMeO\r\nI+UUrHAwRwijjDOTx6WlX9tm0XXnQYSiwOWhA2p1r501/Hlh0nbWjR3ioMBD\r\nmNn91X+WkVmlKXQvWhXXdaT4Rk8lqj9Z4hBaeXWqSThB/Kc5IZ/5RbVYYELQ\r\nOs26gQfS4hFZKei8ogZTz3zH3jtQPG/1VwEVAxHu9dfCV1qimoHm83WWnujg\r\n13lQ1JmDQD1xP+8hUpL+qcELPlI0lRZpKwgTTD81T2lPPv3rtdCmS9eczDEU\r\nURiGoiOeLS+//LXMO249Nw7NbH/HH1+LKeQhmpAxSbyVJIxEXAIG94PcMjnQ\r\nx8R+Ue99DC+zcVY50Qa+hZ+/Ml0ffnPeJIjOviG3wlLyha3U0zlQeBfxG2uB\r\np2I0FhOQQRgBHCDgoECCs7GDYhPLJLU8+MLLqXjqbNoUEGSsBOsXH45J1OWo\r\n0qnpOEC1LEK4iceImc0Kwr9C0VsCkwHRghg=\r\n=F8T/\r\n-----END PGP SIGNATURE-----\r\n","size":27510,"noattachment":false,"key":"/@multiformats/multiaddr/-/@multiformats/multiaddr-11.0.0.tgz"},"_npmUser":{"name":"npm-service-account-multiformats","email":"npm-service-account+multiformats@protocol.ai"},"directories":{},"maintainers":[{"name":"npm-service-account-multiformats","email":"npm-service-account+multiformats@protocol.ai"},{"name":"alanshaw","email":"alan138@gmail.com"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"lidel","email":"lidel@lidel.org"},{"name":"rvagg","email":"r@va.gg"},{"name":"daviddias","email":"mail@daviddias.me"},{"name":"vmx","email":"volker.mische@gmail.com"},{"name":"mikeal","email":"mikeal.rogers@gmail.com"},{"name":"hugomrdias","email":"hugomrdias@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/multiaddr_11.0.0_1663738643242_0.04266996117319266"},"_hasShrinkwrap":false,"readme":"# @multiformats/multiaddr\n\n[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)\n[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-multiaddr.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr)\n[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/multiformats/js-multiaddr/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> multiaddr implementation (binary + string representation of network addresses)\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\nA standard way to represent addresses that\n\n- support any standard network protocol\n- are self-describing\n- have a binary packed format\n- have a nice string representation\n- encapsulate well\n\n## Example\n\n```TypeScript\nimport { multiaddr } from '@multiformats/multiaddr'\nconst addr =  multiaddr(\"/ip4/127.0.0.1/udp/1234\")\n// Multiaddr(/ip4/127.0.0.1/udp/1234)\n\nconst addr = multiaddr(\"/ip4/127.0.0.1/udp/1234\")\n// Multiaddr(/ip4/127.0.0.1/udp/1234)\n\naddr.bytes\n// <Uint8Array 04 7f 00 00 01 11 04 d2>\n\naddr.toString()\n// '/ip4/127.0.0.1/udp/1234'\n\naddr.protos()\n// [\n//   {code: 4, name: 'ip4', size: 32},\n//   {code: 273, name: 'udp', size: 16}\n// ]\n\n// gives you an object that is friendly with what Node.js core modules expect for addresses\naddr.nodeAddress()\n// {\n//   family: 4,\n//   port: 1234,\n//   address: \"127.0.0.1\"\n// }\n\naddr.encapsulate('/sctp/5678')\n// Multiaddr(/ip4/127.0.0.1/udp/1234/sctp/5678)\n```\n\n## Resolving DNSADDR addresses\n\n[DNSADDR](https://github.com/multiformats/multiaddr/blob/master/protocols/DNSADDR.md) is a spec that allows storing a TXT DNS record that contains a Multiaddr.\n\nTo resolve DNSADDR addresses, call the `.resolve()` function the multiaddr, optionally passing a `DNS` resolver.\n\nDNSADDR addresses can resolve to multiple multiaddrs, since there is no limit to the number of TXT records that can be stored.\n\n## Example - Resolving DNSADDR Multiaddrs\n\n```TypeScript\nimport { multiaddr, resolvers } from '@multiformats/multiaddr'\nimport { dnsaddr } from '@multiformats/multiaddr/resolvers'\n\nresolvers.set('dnsaddr', dnsaddr)\n\nconst ma = multiaddr('/dnsaddr/bootstrap.libp2p.io')\n\n// resolve with a 5s timeout\nconst resolved = await ma.resolve({\n  signal: AbortSignal.timeout(5000)\n})\n\nconsole.info(await ma.resolve(resolved)\n// [Multiaddr('/ip4/147.75...'), Multiaddr('/ip4/147.75...'), Multiaddr('/ip4/147.75...')...]\n```\n\n## Example - Using a custom DNS resolver to resolve DNSADDR Multiaddrs\n\nSee the docs for [@multiformats/dns](https://www.npmjs.com/package/@multiformats/dns) for a full breakdown of how to specify multiple resolvers or resolvers that can be used for specific TLDs.\n\n```TypeScript\nimport { multiaddr } from '@multiformats/multiaddr'\nimport { dns } from '@multiformats/dns'\nimport { dnsJsonOverHttps } from '@multiformats/dns/resolvers'\n\nconst resolver = dns({\n  '.': dnsJsonOverHttps('https://cloudflare-dns.com/dns-query')\n})\n\nconst ma = multiaddr('/dnsaddr/bootstrap.libp2p.io')\nconst resolved = await ma.resolve({\n dns: resolver\n})\n\nconsole.info(resolved)\n// [Multiaddr('/ip4/147.75...'), Multiaddr('/ip4/147.75...'), Multiaddr('/ip4/147.75...')...]\n```\n\n# Install\n\n```console\n$ npm i @multiformats/multiaddr\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `MultiformatsMultiaddr` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/@multiformats/multiaddr/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://multiformats.github.io/js-multiaddr>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](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":1663738643468,"_cnpm_publish_time":1663738643468,"dist-tags":{"latest":"13.0.3"}}