1.0.0 • Published 11 months ago

query-parse-serialize v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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