Go to file
Henrique Dias ac2d98c49a fix: IPv6 rfc3986 compliancy
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
2019-01-13 10:12:30 +00:00
.gitignore initial commit 2018-03-20 14:39:26 +00:00
.travis.yml initial commit 2018-03-20 14:39:26 +00:00
index.js fix: IPv6 rfc3986 compliancy 2019-01-13 10:12:30 +00:00
LICENSE initial commit 2018-03-20 14:39:26 +00:00
package-lock.json 4.0.0 2018-07-24 13:28:45 +01:00
package.json 4.0.0 2018-07-24 13:28:45 +01:00
README.md renames to multiaddr-to-uri 2018-03-21 10:09:39 +00:00
test.js fix: IPv6 rfc3986 compliancy 2019-01-13 10:12:30 +00:00

multiaddr-to-uri

Build Status dependencies Status JavaScript Style Guide

Convert a Multiaddr to a URI /dnsaddr/ipfs.io/http -> http://ipfs.io

Install

npm install multiaddr-to-uri

Usage

const toUri = require('multiaddr-to-uri')

console.log(toUri('/dnsaddr/protocol.ai/https'))
// -> https://protocol.ai

Note:

  • Might be lossy - e.g. a DNSv6 multiaddr
  • Can throw if the passed multiaddr:
    • is not a valid multiaddr
    • is not supported as a URI e.g. circuit

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

MIT © Alan Shaw