🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

append-querystring

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

append-querystring

Append anything to a URL's query-string

1.0.0
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
0
Weekly downloads
 
Created
Source

append-querystring

Append anything to a URL's query-string.

Install

Using npm:

npm install append-querystring --save

Example

const append = require('append-querystring');

const original = 'http://landing-page.com/?s1=sid1&sid2=sid3';
const result = append("http://click-url.com/?affid=1", original, {object_format_sid: "Hello Friends"});

console.log(result);
// Output: http://click-url.com/?affid=1&s1=sid1&sid2=sid3&object_format_sid=Hello%20Friends

Usage

The exported function takes a base URL as its first argument, followed by any number of additional arguments that can be:

  • URL strings
  • Query string fragments (with or without a leading '?')
  • Objects with key-value pairs to be added to the query string

The function returns a new URL with all the query parameters combined.

FAQs

Package last updated on 17 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts