Join all arguments together and normalize the resulting url.
Install
1 | npm install url-join |
Usage
1 | var urljoin = require('url-join'); |
Prints:
1 | 'http://www.google.com/a/b/cd?foo=123' |
Browser and AMD
It also works in the browser, you can either include lib/url-join.js in your page:
1 | <script src="url-join.js"></script> |
Or using an AMD module system like requirejs:
1 | define(['path/url-join.js'], function (urljoin) { |
License
MIT