
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@multiformats/multiaddr-to-uri
Advanced tools
Convert a Multiaddr to a URI
This module allows easy conversion of Multiaddrs to string URIs.
import { multiaddrToUri } from '@multiformats/multiaddr-to-uri'
console.log(multiaddrToUri('/dnsaddr/protocol.ai/https'))
// -> https://protocol.ai
console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080'))
// -> http://127.0.0.1:8080
console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080', { assumeHttp: false }))
// -> tcp://127.0.0.1:8080
Note:
/tcp is the last (terminating) protocol HTTP is assumed by default (implicit assumeHttp: true)
http:// instead of tcp://{ assumeHttp: false } disables this behavior$ npm i @multiformats/multiaddr-to-uri
<script> tagLoading this module through a script tag will make its exports available as MultiformatsMultiaddrToUri in the global namespace.
<script src="https://unpkg.com/@multiformats/multiaddr-to-uri/dist/index.min.js"></script>
Licensed under either of
Unless 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.
FAQs
Convert a Multiaddr to a URI
The npm package @multiformats/multiaddr-to-uri receives a total of 92,601 weekly downloads. As such, @multiformats/multiaddr-to-uri popularity was classified as popular.
We found that @multiformats/multiaddr-to-uri demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.