Socket
Socket
Sign inDemoInstall

urlconcat

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlconcat - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

2

package.json
{
"name": "urlconcat",
"version": "0.0.10",
"version": "0.0.11",
"description": "Concats paths in an url, places slashes where necessary.",

@@ -5,0 +5,0 @@ "main": "urlconcat.js",

@@ -0,1 +1,3 @@

[![Build Status](https://travis-ci.org/andersem/urlconcat.svg?branch=master)](https://travis-ci.org/andersem/urlconcat)
# urlconcat

@@ -12,21 +14,36 @@ Concats paths in an url, places slashes where necessary.

### CommonJS
### Importing
All these methods work:
```javascript
var urlconcat = require('urlconcat');
urlconcat.concat('http://localhost:8080/', 'search', 'something'); // 'http://localhost:8080/search/something'
var concat = urlconcat.concat;
```
### ES2015
```javacript
import urlconcat from 'urlconcat';
const concat = urlconcat.concat;
```
```javascript
import urlconcat from 'urlconcat';
urlconcat.concat('http://localhost:8080/', 'search', 'something'); // 'http://localhost:8080/search/something'
import { concat } from 'urlconcat';
```
or
### Using
It will place slashes between url parts, but not before query parameters:
```javascript
import { concat } from 'urlconcat';
concat('http://localhost:8080/', 'search', 'something'); // 'http://localhost:8080/search/something'
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:
```javascript
concat('http://localhost:8080/', '/search')
// 'http://localhost:8080/search
```
It will leave trailing slashes:
```javascript
concat('http://localhost:8080/', 'search/')
// 'http://localhost:8080/search
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc