Go to file
2018-03-20 14:39:26 +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 initial commit 2018-03-20 14:39:26 +00:00
LICENSE initial commit 2018-03-20 14:39:26 +00:00
package-lock.json initial commit 2018-03-20 14:39:26 +00:00
package.json initial commit 2018-03-20 14:39:26 +00:00
README.md initial commit 2018-03-20 14:39:26 +00:00
test.js initial commit 2018-03-20 14:39:26 +00:00

multiaddr-to-stupid-string

Build Status dependencies Status JavaScript Style Guide

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

Install

npm install multiaddr-to-stupid-string

Usage

const toStupid = require('multiaddr-to-stupid-string')

console.log(toStupid('/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 stupid string e.g. circuit

Contribute

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

License

MIT © Alan Shaw