Skip to content

Latest commit

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Build Status

urlconcat

Concats paths in an url, places slashes where necessary.

Installation

npm install urlconcat --save

Usage

Importing

All these methods work:

varurlconcat=require('urlconcat');varconcat=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/

About

Concats paths in an url, places slashes where necessary.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages