{"name":"@multiformats/multiaddr-matcher","version":"1.5.0","keywords":["multiaddr"],"license":"Apache-2.0 OR MIT","_id":"@multiformats/multiaddr-matcher@1.5.0","maintainers":[{"name":"npm-service-account-multiformats","email":"npm-service-account+multiformats@ipfs.tech"},{"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"}],"homepage":"https://github.com/multiformats/js-multiaddr-matcher#readme","bugs":{"url":"https://github.com/multiformats/js-multiaddr-matcher/issues"},"dist":{"shasum":"784f7f5f53ffb8402843c1fa81da0eee83a3f28c","tarball":"http://registry-npm.ywwl.com/@multiformats/multiaddr-matcher/download/@multiformats/multiaddr-matcher-1.5.0.tgz","fileCount":15,"integrity":"sha512-nA6lJpzjN1TZ1G9BM5QoVIBspbnPxnlVbJMvvaAR992K0t3G5c5vKCEMuUzanAE5VRrJ1MXHDhHonTeKoT/eTg==","signatures":[{"sig":"MEYCIQCWxbFVLzhEGJyqRGB22ELY1r7RSImEDg4Ml1Q60tEZRAIhAONFspVFDY+7MJ/7jK9JR0GYYh+Fdgb9Ex256QzVa34i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@multiformats%2fmultiaddr-matcher@1.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":78711,"size":14592,"noattachment":false,"key":"/@multiformats/multiaddr-matcher/-/@multiformats/multiaddr-matcher-1.5.0.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./utils":{"types":"./dist/src/utils.d.ts","import":"./dist/src/utils.js"}},"gitHead":"10f731f380bc0a4bd4547ddde9a8f85b2aef294e","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","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","test:chrome":"aegir test -t browser","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-matcher.git","type":"git"},"_npmVersion":"10.9.0","description":"Match different multiaddr formats","directories":{},"_nodeVersion":"22.11.0","dependencies":{"multiformats":"^13.0.0","@chainsafe/is-ip":"^2.0.1","@multiformats/multiaddr":"^12.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.1"},"_npmOperationalInternal":{"tmp":"tmp/multiaddr-matcher_1.5.0_1730730566957_0.30202580739700235","host":"s3://npm-registry-packages"},"readme":"# @multiformats/multiaddr-matcher\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-matcher.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr-matcher)\n[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr-matcher/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/multiformats/js-multiaddr-matcher/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Match different multiaddr formats\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\nThis module exports various matchers that can be used to infer the type of a\npassed multiaddr.\n\n## Example\n\n```ts\nimport { multiaddr } from '@multiformats/multiaddr'\nimport { DNS } from '@multiformats/multiaddr-matcher'\n\nconst ma = multiaddr('/dnsaddr/example.org')\n\nDNS.matches(ma) // true - this is a multiaddr with a DNS address at the start\n```\n\n## Example\n\nThe default matching behaviour ignores any subsequent tuples in the multiaddr.\nIf you want stricter matching you can use `.exactMatch`:\n\n```ts\nimport { multiaddr } from '@multiformats/multiaddr'\nimport { DNS, Circuit } from '@multiformats/multiaddr-matcher'\n\nconst ma = multiaddr('/dnsaddr/example.org/p2p/QmFoo/p2p-circuit/p2p/QmBar')\n\nDNS.exactMatch(ma) // false - this address has extra tuples after the DNS component\nCircuit.matches(ma) // true\nCircuit.exactMatch(ma) // true - the extra tuples are circuit relay related\n```\n\n# Install\n\n```console\n$ npm i @multiformats/multiaddr-matcher\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make its exports available as `MultiformatsMultiaddrMatcher` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/@multiformats/multiaddr-matcher/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://multiformats.github.io/js-multiaddr-matcher>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/multiformats/js-multiaddr-matcher/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/multiformats/js-multiaddr-matcher/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":1730730567211,"_cnpm_publish_time":1730730567211,"dist-tags":{"latest":"3.0.2"}}