How do you parse a URL in deno like node.js
url.parse()
?
No external module is needed to parse URLs in Deno. The URL
class is available as a global, just like in your browser:
const urlString = "https://www.google.com";
const url = new URL(urlString);
console.log(`URL: ${url.protocol}//${url.host}`);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With