Is this safe to use require(\"path\").join to concatenate URLs, for example:
require(\"path\").join(\"http://example.com\", \"ok\"); 
//returns          
        
By the time posting this answer url.resolve() is deprecated;
I did following to join to path in Nodejs:
const path = require('path');
const url = require('url');
let myUrl = new URL('http://ignore.com');
myUrl.pathname=path.join(firstpath, secondpath);
console.log(myUrl.pathname)
This approach logs correct url path and it works for my case.
What is your opinion about this approach?
Thanks