0.0.12 • Published 10 years ago

urlconcat v0.0.12

Weekly downloads
86
License
MIT
Repository
github
Last release
10 years ago

Build Status

urlconcat

Concats paths in an url, places slashes where necessary.

Installation

npm install urlconcat --save

Usage

Importing

All these methods work:

var urlconcat = require('urlconcat');
var concat = urlconcat.concat;
import urlconcat from 'urlconcat';
const concat = urlconcat.concat;
import { concat } from 'urlconcat';

Using

It will place slashes between url parts, but not before query parameters:

concat('http://localhost:8080/', 'api/search', 'something', '?a=b&b=c'); 
// 'http://localhost:8080/api/search/something?a=b&b=c'

It will remove double slashes:

concat('http://localhost:8080/', '/search')
// 'http://localhost:8080/search

It will leave trailing slashes:

concat('http://localhost:8080/', 'search/')
// 'http://localhost:8080/search/
0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago