URL の文字列解析を行う標準モジュールです。
// urlconst url = require("url");const myUrl=url.parse('https://sample@sub.example.com:8080/p/a?query=string#hash');