{"name":"@multiformats/mafmt","version":"0.0.0","description":"","main":"index.js","license":"(Apache-2.0 OR MIT)","_id":"@multiformats/mafmt@0.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-XZ07hmZd+gSZ3SRgY4lRCue/nKWsgCRElyUp+YRMZxkM13Xomk8u9kV3hzliconTblbervN7wxpdf2aqXmh7zQ==","shasum":"7eb6f008d035d888723a5e71a3924146b05873c7","tarball":"http://registry-npm.ywwl.com/@multiformats/mafmt/download/@multiformats/mafmt-0.0.0.tgz","fileCount":1,"unpackedSize":137,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1JwjCRA9TVsSAnZWagAA0nMP/2hdRAPI5C+vnvhLHM1Z\ncSDkbgwxC/adFXyiGyRl79Q09vmDDZN6rvnRZTkg1cqq4XkM+l4Scr4TMRe+\nkMahWPWcU1xf3tFW1H2fzNNiJJ3Y+xDsDoV1yL27//cdvPiS81XNW+sRzy0/\nkViLU1L+GHXePzAm4W3MFcQGdBU6JADMR6Td2F7+GtJt2uYf+6irM8YA6o44\nRzXefFsmRYtLAZnO9BSMJu5HwFaSsaxozt/dfOB0ZJqLI12sB34v8NJCzEZD\nvux/zqs+eqlhPp2jjiiTWbHaLq72D2M9kni2tuIieoFHEFZoeYoAGLauPgMI\nMkBMhirWMOSvIx0aaou6f4GewSOuirSbJPXm2FGp8vIIELiDl+kMSbH/4RKF\nz7pjbUKz+R3i8lQmCjlPv3Rl/3AqjSp7+/X56tPjPcY0wqfqmHzBvNZhOi4b\nIF88066yO8hZ/C6Avpm9uRZg9xWx7zaeMdLqXodEqE4xXUrAfgPksWYLwY0m\nm7Q7EZGiVt47izge8DEvtpnvCRQqzSWqz1/VGgNvppdywNi+ImCg5wVZIBfO\nrk/n9gPfO3oYc61rQdhZg4sHvnrfA4dIbTbb9UXO9fTTsxDUa/AeSn0WDu1e\n3ysSlhc2MueDwIsOpuisK85Fsfxo+UYGZ71NASujs5XhYVcIUi5mEOlxrpOX\noeos\r\n=dry7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSfX4OOeAhMYM7lcCAevfuCjIFTljwi5QWl2+iO/u/EAiB4tVi3qX1SPOk0IjYmYPnvWPE43PEEbc4f2UHoB8q3EA=="}],"size":205,"noattachment":false,"key":"/@multiformats/mafmt/-/@multiformats/mafmt-0.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"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_0.0.0_1641323555173_0.43949048723024386"},"_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":1641323555295,"_cnpm_publish_time":1641323555295,"dist-tags":{"latest":"12.1.6"}}