@w6s/query-string
v1.2.1
Published
Parse and stringify URL
Downloads
6
Readme
@w6s/query-string
Parse and stringify URL
Install
npm install --save @w6s/query-string
Usage
import { parse, stringify, getParam } from '@w6s/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