workplus-query-string

Parse and stringify URL

Usage no npm install needed!

<script type="module">
  import workplusQueryString from 'https://cdn.skypack.dev/workplus-query-string';
</script>

README

workplus-query-string npm

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