query-parse-serialize
v1.0.0
Published
A library for parsing and serializing query strings in JavaScript
Downloads
5
Maintainers
Readme
query-parse-serialize
A library for parsing and serializing query strings in JavaScript.
Install
npm install query-parse-serialize
Usage
import { parse, serialize } from 'query-parse-serialize'
const query = parse('a=1&b=2&b=3', { ignoreNoValue: true })
console.log(query) // { a: 1, b: [2, 3] }
const queryStr = serialize({ a: 1, b: 2, c: 3 }, { withPrefix: true })
console.log(queryStr) // '?a=1&b=2&c=3'
Test
npm test
License
MIT