Package Exports
- multiaddr-to-uri
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (multiaddr-to-uri) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
multiaddr-to-uri
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