workplus-query-string
v1.2.0
Published
Parse and stringify URL
Downloads
7
Readme
workplus-query-string
Parse and stringify URL
Install
npm install --save workplus-query-string
Usage
import { parse, stringify, getParam } from 'workplus-query-string';
// If location.search = '?a=1&b=2&c=3'
let params = parse();
// params => {a: "1", b: "2", c: "3"}
let obj = {
x: 1,
y: 2,
},
let str = stringify(obj);
// str => 'x=1&y=2'
let val = getParam('a');
// val => '1'
License
MIT