const normalizeUrl = require("normalize-url");
main();
function main(){
let url = 'doctify.co.uk';
website = normalizeUrl(url);
console.log(website);
}
const urlObj = new URL(urlString);
^
ReferenceError: URL is not defined
at normalizeUrl (/home/xxx/Dropbox/Node/Dealwatch/node_modules/normalize-url/index.js:93:17)
at main (/home/xxx/Dropbox/Node/Dealwatch/test.js:6:12)
at Object.<anonymous> (/home/xxx/Dropbox/Node/Dealwatch/test.js:3:1)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
with a fresh plain test.js