File: README.md

package info (click to toggle)
node-url-join 0.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 80 kB
  • ctags: 1
  • sloc: makefile: 2; sh: 2
file content (27 lines) | stat: -rw-r--r-- 580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Join all arguments together and normalize the resulting url.

## Install

~~~
npm install url-join
~~~

## Usage

~~~javascript
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](http://nodejs.org/api/path.html#path_path_join_path1_path2) 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