1.0.1 • Published 2 years ago

add-query-params v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

add-query-params

About

add-query-params as the name suggests is a function that returns URL with the provided query parameters.

Installation

npm i add-query-params

Usage

Add the addQueryParams function in your Application. Pass down your URL as the first and your query parameters as the second parameter.

Query parameters are passed down as object in the form of key:value pairs:

import addQueryParams from 'add-query-params';
// OR
const addQueryParams = require('add-query-params');




const url = 'https://www.somerandomurl.com/';

const withQueryParams = addQueryParams(url, {'username': 'farrukhayazqazi', age: '24'}); 

// returns https://www.somerandomurl.com/?username=farrukhayazqazi&age=24;
1.0.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago