url.parse已弃用
const myURL = new URL('https://www.a.com:8888/b.html?c=1#d');console.log(myURL);输出URL { href: 'https://www.a.com:8888/b.html?c=1#d', origin: 'https://www.a.com:8888', protocol: 'https:', username: '', password: '', host: 'www.a.com:8888', hostname: 'www.a.com', port: '8888', pathname: '/b.