1.0.0 • Published 7 months ago

append-querystring v1.0.0

Weekly downloads
144
License
-
Repository
github
Last release
7 months ago

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.

1.0.0

7 months ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago