{"name":"@multiformats/mafmt","version":"12.1.1","description":"A multiaddr validator","license":"Apache-2.0 OR MIT","homepage":"https://github.com/multiformats/js-mafmt#readme","repository":{"type":"git","url":"git+https://github.com/multiformats/js-mafmt.git"},"bugs":{"url":"https://github.com/multiformats/js-mafmt/issues"},"keywords":["multiaddr"],"engines":{"node":">=16.0.0","npm":">=7.0.0"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/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","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","test:electron-main":"aegir test -t electron-main","release":"aegir release","docs":"aegir docs"},"dependencies":{"@multiformats/multiaddr":"^12.0.0"},"devDependencies":{"aegir":"^38.1.7","uint8arrays":"^4.0.3","util":"^0.12.3"},"gitHead":"1b2922c41511f1f7db9092d88ad73bdbb7fafaac","_id":"@multiformats/mafmt@12.1.1","_nodeVersion":"18.16.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-RhGdmyybSbdIP69+GD6gpAxAweAtN5pKjrr0IZlwoCqATg7OVPVgErBCeypCgJV3yulGIiYPaDM6gM1M6GgT8g==","shasum":"10129f36b1b603893af6c726d39f175a7e3b0604","tarball":"http://registry-npm.ywwl.com/@multiformats/mafmt/download/@multiformats/mafmt-12.1.1.tgz","fileCount":10,"unpackedSize":72683,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3aVL0t/zMFNyehQ+TY7kA7rtx2Oe1NVPqvCcQ5+dzGgIgGNdOmyXDz1AgOhRyxfzkUccOfVFBls8eg9AppqQMNeg="}],"size":19394,"noattachment":false,"key":"/@multiformats/mafmt/-/@multiformats/mafmt-12.1.1.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/mafmt_12.1.1_1684137522095_0.9159661335389571"},"_hasShrinkwrap":false,"readme":"# @multiformats/mafmt <!-- omit in toc -->\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-mafmt.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-mafmt)\n[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-mafmt/js-test-and-release.yml?branch=master\\&style=flat-square)](https://github.com/multiformats/js-mafmt/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n> A multiaddr validator\n\n## Table of contents <!-- omit in toc -->\n\n- [Install](#install)\n  - [Browser `<script>` tag](#browser-script-tag)\n- [Usage](#usage)\n- [API](#api)\n  - - [`mafmt.<FORMAT>.matches(multiaddr)`](#mafmtformatmatchesmultiaddr)\n- [API Docs](#api-docs)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i @multiformats/mafmt\n```\n\n### Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `MultiformatsMafmt` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/@multiformats/mafmt/dist/index.min.js\"></script>\n```\n\n## Usage\n\n```js\nimport * as mafmt from '@multiformats/mafmt'\n\nmafmt.DNS.matches('/dns4/ipfs.io') // true\n```\n\n## API\n\n#### `mafmt.<FORMAT>.matches(multiaddr)`\n\nWhere `<FORMAT>` may be:\n\n| `<FORMAT>`         | Description                                                                                                                                                                                                               | Example(s)                                                                                                                                       |\n| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `DNS`              | a \"dns4\" or \"dns6\" format multiaddr                                                                                                                                                                                       | `/dnsaddr/ipfs.io`                                                                                                                               |\n| `DNS4`             | a \"dns4\" format multiaddr                                                                                                                                                                                                 | `/dns4/ipfs.io`                                                                                                                                  |\n| `DNS6`             | a \"dns6\" format multiaddr                                                                                                                                                                                                 | `/dns6/protocol.ai/tcp/80`                                                                                                                       |\n| `IP`               | an \"ip4\" or \"ip6\" format multiaddr                                                                                                                                                                                        | `/ip4/127.0.0.1` <br> `/ip6/fc00::`                                                                                                              |\n| `TCP`              | a \"tcp\" over `IP` format multiaddr                                                                                                                                                                                        | `/ip4/0.0.7.6/tcp/1234`                                                                                                                          |\n| `UDP`              | a \"udp\" over `IP` format multiaddr                                                                                                                                                                                        | `/ip4/0.0.7.6/udp/1234`                                                                                                                          |\n| `QUIC`             | a \"quic\" over `UDP` format multiaddr                                                                                                                                                                                      | `/ip4/1.2.3.4/udp/1234/quic`                                                                                                                     |\n| `UTP`              | a \"utp\" over `UDP` format multiaddr                                                                                                                                                                                       | `/ip4/1.2.3.4/udp/3456/utp`                                                                                                                      |\n| `Websockets`       | a \"ws\" over `TCP` or \"ws\" over `DNS` format multiaddr                                                                                                                                                                     | `/ip4/1.2.3.4/tcp/3456/ws` <br> `/dnsaddr/ipfs.io/ws`                                                                                            |\n| `WebSocketsSecure` | a \"wss\" over `TCP` or \"wss\" over `DNS` format multiaddr                                                                                                                                                                   | `/ip6/::/tcp/0/wss` <br> `/dnsaddr/ipfs.io/wss`                                                                                                  |\n| `HTTP`             | a \"http\" over `TCP` or `DNS` or \"http\" over `DNS` format multiaddr                                                                                                                                                        | `/ip4/127.0.0.1/tcp/90/http` <br> `/dnsaddr/ipfs.io/http`                                                                                        |\n| `HTTPS`            | a \"https\" over `TCP` or `DNS` or \"https\" over `DNS` format multiaddr                                                                                                                                                      | `/ip4/127.0.0.1/tcp/90/https` <br> `/dnsaddr/ipfs.io/https`                                                                                      |\n| `WebRTCStar`       | a \"p2p\" over \"p2p-webrtc-star\" over `Websockets` or \"p2p\" over \"p2p-webrtc-star\" over `WebSocketsSecure` format multiaddr                                                                                                 | `/dnsaddr/ipfs.io/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4`                                                        |\n| `WebSocketStar`    | a \"p2p\" over \"p2p-websocket-star\" over `Websockets` or \"p2p\" over \"p2p-websocket-star\" over `WebSocketsSecure` or \"p2p-websocket-star\" over `Websockets` or \"p2p-websocket-star\" over `WebSocketsSecure` format multiaddr | `/ip4/1.2.3.4/tcp/3456/ws/p2p-websocket-star` <br> `/dnsaddr/localhost/ws/p2p-websocket-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` |\n| `WebRTCDirect`     | a \"p2p-webrtc-direct\" over `HTTP` or \"p2p-webrtc-direct\" over `HTTPS` format multiaddr                                                                                                                                    | `/ip4/1.2.3.4/tcp/3456/http/p2p-webrtc-direct`                                                                                                   |\n| `Reliable`         | a `WebSockets` or `WebSocketsSecure` or `HTTP` or `HTTPS` or `WebRTCStar` or `WebRTCDirect` or `TCP` or `UTP` or `QUIC` format multiaddr                                                                                  | `/dnsaddr/ipfs.io/wss`                                                                                                                           |\n| `Circuit`          |                                                                                                                                                                                                                           | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4/p2p-circuit/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj`                             |\n| `P2P`              | \"p2p\", aka \"ipfs\", over `Reliable` or `WebRTCStar` or \"p2p\" format multiaddr                                                                                                                                              | `/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSoooo4` <br> `/ip4/127.0.0.1/tcp/20008/ws/p2p/QmUjNmr8TgJCn1Ao7DvMy4cjoZU15b9bwSCBLE3vwXiwgj`      |\n\nWhere `multiaddr` may be:\n\n- a [Multiaddr](https://www.npmjs.com/package/@multiformats/multiaddr)\n- a String\n- a [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)\n\nReturns `true`/`false`\n\n## API Docs\n\n- <https://multiformats.github.io/js-mafmt>\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":1684137522311,"_cnpm_publish_time":1684137522311,"dist-tags":{"latest":"12.1.6"}}