/ live.thehmm.nl / back / node_modules / url-join /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]bin/2 years ago -  
[DIR]lib/2 years ago -  
[DIR]test/2 years ago -  
[TXT]CHANGELOG.md40 years ago6.1K 
[   ]LICENSE40 years ago1.1K 
[TXT]README.md40 years ago745 d7c1522 post receive test [كارل مبارك]
[   ]package.json2 years ago1.5K 
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);

Prints:

'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:

<script src="url-join.js"></script>
<script type="text/javascript">
    urljoin('http://blabla.com', 'foo?a=1')
</script>

Or using an AMD module system like requirejs:

define(['path/url-join.js'], function (urljoin) {
  urljoin('http://blabla.com', 'foo?a=1');
});

License

MIT

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80