easy-qs
v1.10.0
Published
A zero dependency tool for convert url params to an object, or convert an object to url params
Downloads
15
Maintainers
Readme
easy-qs
A zero dependency, small and fast library for parse url params to an object, also can convert an object to string as url params
Install
npm i easy-qs
Usage
parse(query)
import { parse } from 'easy-qs';
parse(location.search) // ?a=1&b=2 => {a: '1', b: '2'}
parse(location.hash) // #a=1 => {a: '1'}
stringify(obj, prefix?)
import { stringify } from 'easy-qs';
stringify({ a: 1, b: 2 }) // 'a=1&b=2'
stringify({ a: 1, b: 2 }, '&') // '&a=1&b=2'
License
MIT