kubernetes-handbook/node_modules/url-join
Jimmy Song c6db5e8fef
add node modules
2021-04-13 00:24:28 +08:00
..
lib add node modules 2021-04-13 00:24:28 +08:00
test add node modules 2021-04-13 00:24:28 +08:00
.npmignore add node modules 2021-04-13 00:24:28 +08:00
README.md add node modules 2021-04-13 00:24:28 +08:00
package.json add node modules 2021-04-13 00:24:28 +08:00

README.md

Join all arguments together and normalize the resulting url.

Install

npm install url-join

Usage

var urljoin = require('url-join');

var fullUrl = urljoin('http://www.google.com', 'a', '/b/cd', '?foo=123');

console.log(fullUrl);

\\will print:

'http://www.google.com/a/b/cd?foo=123'

This works similar to path.join but you shouldn't use path.join for urls since it will work different depending of the operative systems but also doesn't work for some cases.

License

MIT