{"name":"@multiformats/multiaddr","version":"12.4.0","keywords":["binary","multiaddr","string"],"license":"Apache-2.0 OR MIT","_id":"@multiformats/multiaddr@12.4.0","maintainers":[{"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"},{"name":"alanshaw","email":"alan138@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"rvagg","email":"r@va.gg"},{"name":"lidel","email":"lidel@lidel.org"},{"name":"npm-service-account-multiformats","email":"npm-service-account+multiformats@ipfs.tech"}],"homepage":"https://github.com/multiformats/js-multiaddr#readme","bugs":{"url":"https://github.com/multiformats/js-multiaddr/issues"},"dist":{"shasum":"13fca8d68805fe0d0569bdd7d4dce41497503d31","tarball":"http://registry-npm.ywwl.com/@multiformats/multiaddr/download/@multiformats/multiaddr-12.4.0.tgz","fileCount":50,"integrity":"sha512-FL7yBTLijJ5JkO044BGb2msf+uJLrwpD6jD6TkXlbjA9N12+18HT40jvd4o5vL4LOJMc86dPX6tGtk/uI9kYKg==","signatures":[{"sig":"MEQCIG3YkKx8323V7ub5oQwt7EbYfS6fetrYL3ClQIhEbkSXAiBxFjIh0E8Q5FA2Zn5VJTw1ypJe0NZMg6fOe5LDAAQzBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@multiformats%2fmultiaddr@12.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":201566,"size":46097,"noattachment":false,"key":"/@multiformats/multiaddr/-/@multiformats/multiaddr-12.4.0.tgz"},"type":"module","types":"./dist/src/index.d.ts","browser":{"./dist/src/resolvers/dns.js":"./dist/src/resolvers/dns.browser.js"},"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"}},"gitHead":"744e07ad431472754164cdefe1ecedb18bf455eb","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"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"],"branches":["main"]},"scripts":{"docs":"aegir docs","lint":"aegir lint","test":"aegir test -f","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","doc-check":"aegir doc-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-multiformats","email":"npm-service-account+multiformats@ipfs.tech"},"repository":{"url":"git+https://github.com/multiformats/js-multiaddr.git","type":"git"},"_npmVersion":"10.9.2","description":"multiaddr implementation (binary + string representation of network addresses)","directories":{},"_nodeVersion":"22.13.1","dependencies":{"uint8arrays":"^5.0.0","multiformats":"^13.0.0","uint8-varint":"^2.0.1","@chainsafe/is-ip":"^2.0.1","@multiformats/dns":"^1.0.3","@chainsafe/netmask":"^2.0.0"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"publishConfig":{"access":"public","provenance":true},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^45.0.2","sinon":"^19.0.2","sinon-ts":"^2.0.0","@types/sinon":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/multiaddr_12.4.0_1740054511181_0.6638104476625628","host":"s3://npm-registry-packages-npm-production"},"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> The JavaScript implementation of the Multiaddr spec\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- 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'\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.getComponents()\n// [\n//   { code: 4, name: 'ip4', value: '127.0.0.1' },\n//   { code: 273, name: 'udp', value: '1234' }\n// ]\n\naddr.encapsulate('/sctp/5678')\n// Multiaddr(/ip4/127.0.0.1/udp/1234/sctp/5678)\n```\n\n## Example - Adding custom protocols\n\nTo add application-specific or experimental protocols, add a protocol codec\nto the protocol registry:\n\n```ts\nimport { registry, V, multiaddr } from '@multiformats/multiaddr'\nimport type { ProtocolCodec } from '@multiformats/multiaddr'\n\nconst maWithCustomTuple = '/custom-protocol/hello'\n\n// throws UnknownProtocolError\nmultiaddr(maWithCustomTuple)\n\nconst protocol: ProtocolCodec = {\n  code: 2059,\n  name: 'custom-protocol',\n  size: V\n  // V means variable length, can also be 0, a positive integer (e.g. a fixed\n  // length or omitted\n}\n\nregistry.addProtocol(protocol)\n\n// does not throw UnknownProtocolError\nmultiaddr(maWithCustomTuple)\n\n// protocols can also be removed\nregistry.removeProtocol(protocol.code)\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 its 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](https://github.com/multiformats/js-multiaddr/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/multiformats/js-multiaddr/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":1740054511406,"_cnpm_publish_time":1740054511406,"dist-tags":{"latest":"13.0.3"}}