{"id":20850589,"url":"https://github.com/multiformats/js-multiaddr-to-uri","last_synced_at":"2025-04-09T07:10:48.996Z","repository":{"id":36931718,"uuid":"126032198","full_name":"multiformats/js-multiaddr-to-uri","owner":"multiformats","description":"Convert a Multiaddr to a URI /dnsaddr/ipfs.io/http -\u003e http://ipfs.io","archived":false,"fork":false,"pushed_at":"2024-11-08T18:55:51.000Z","size":513,"stargazers_count":7,"open_issues_count":0,"forks_count":11,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-12-11T09:29:04.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiformats.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-20T14:38:47.000Z","updated_at":"2024-11-08T18:55:36.000Z","dependencies_parsed_at":"2024-03-21T15:59:30.006Z","dependency_job_id":"9dffc3d7-a9a9-4e25-a4ac-4f5ada963e85","html_url":"https://github.com/multiformats/js-multiaddr-to-uri","commit_stats":{"total_commits":76,"total_committers":14,"mean_commits":5.428571428571429,"dds":0.8289473684210527,"last_synced_commit":"d2e3c2579649bbb19acbd4f742d31c386a8f2307"},"previous_names":["tableflip/multiaddr-to-stupid-string"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-multiaddr-to-uri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-multiaddr-to-uri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-multiaddr-to-uri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fjs-multiaddr-to-uri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/js-multiaddr-to-uri/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994122,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T03:10:27.546Z","updated_at":"2025-04-09T07:10:48.976Z","avatar_url":"https://github.com/multiformats.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @multiformats/multiaddr-to-uri \u003c!-- omit in toc --\u003e\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-to-uri.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr-to-uri)\n[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr-to-uri/js-test-and-release.yml?branch=main\\\u0026style=flat-square)](https://github.com/multiformats/js-multiaddr-to-uri/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n\u003e Convert a Multiaddr to a URI\n\n# About\n\nThis module allows easy conversion of Multiaddrs to string URIs.\n\n## Example - Converting multiaddrs to string URIs\n\n```js\nimport { multiaddrToUri } from '@multiformats/multiaddr-to-uri'\n\nconsole.log(multiaddrToUri('/dnsaddr/protocol.ai/https'))\n// -\u003e https://protocol.ai\n\nconsole.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080'))\n// -\u003e http://127.0.0.1:8080\n\nconsole.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080', { assumeHttp: false }))\n// -\u003e tcp://127.0.0.1:8080\n```\n\nNote:\n\n- When `/tcp` is the last (terminating) protocol HTTP is assumed by default (implicit `assumeHttp: true`)\n  - this means produced URIs will start with `http://` instead of `tcp://`\n  - passing `{ assumeHttp: false }` disables this behavior\n- Might be lossy - e.g. a DNSv6 multiaddr\n- Can throw if the passed multiaddr:\n  - is not a valid multiaddr\n  - is not supported as a URI e.g. circuit\n\n# Install\n\n```console\n$ npm i @multiformats/multiaddr-to-uri\n```\n\n## Browser `\u003cscript\u003e` tag\n\nLoading this module through a script tag will make it's exports available as `MultiformatsMultiaddrToUri` in the global namespace.\n\n```html\n\u003cscript src=\"https://unpkg.com/@multiformats/multiaddr-to-uri/dist/index.min.js\"\u003e\u003c/script\u003e\n```\n\n# API Docs\n\n- \u003chttps://multiformats.github.io/js-multiaddr-to-uri\u003e\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / \u003chttp://opensource.org/licenses/MIT\u003e)\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fjs-multiaddr-to-uri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fjs-multiaddr-to-uri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fjs-multiaddr-to-uri/lists"}