join-url
v2.0.0
Published
Like `path.join` but for urls.
Downloads
1,058
Maintainers
Readme
Like path.join
for urls.
Installation
npm install join-url
Example
var join = require('join-url');
join.pathname("/admin/", "dashboard/", "/messages", "new");
//-> "/admin/dashboard/messages/new"
join.hostname(".sub.", "domain.", ".co", "uk");
//-> "sub.domain.co.uk"
join.query("&a=1&", "b=2&", "&c=3", "d=4");
//-> "a=1&b=2&c=3&d=4"
Contributions
- Use
npm test
to run tests.
Please feel free to create a PR!