query-strings
v0.1.0
Published
A Node.js package for appending query parameters to URLs. This package provides a 'queryString' function that takes a URL string and an object containing key-value pairs of parameters to add. It returns the updated URL with the appended query parameters.
Downloads
137
Readme
query-strings
URL Query String Appender
A Node.js package for appending query parameters to URLs.
Installation
Install the package via npm:
npm install query-strings --save
Usage
const { queryString } = require('query-strings');
// Example usage:
const url = 'http://www.example.com';
const params = {
test1: 'hello',
test2: 'world'
};
const result = queryString(url, params);
console.log(result);
// Output: http://www.example.com?test1=hello&test2=world