garycourt / uri-js

An RFC 3986 compliant, scheme extendable URI parsing/validating/normalizing/resolving library for JavaScript
Other
305 stars 69 forks source link

Add support for parsing query string into object #34

Closed chefhoobajoob closed 5 years ago

chefhoobajoob commented 6 years ago

Didn't see this anywhere in the tests or documentation - ignore if there's already support for this.

Looking for something that supports a usage like:

const uriString = 'rando://bubba-gump?hello=there&whatever=you-say'
const uri = URI.parse(uriString)
const query = URI.parseQuery(uri)
const whatever = query.whatever
garycourt commented 5 years ago

URI.js does not parse query strings as WWW Form Url Encoded query strings are part of the HTML4+ spec, and not the HTTP/URI spec. As such, I made a call that it was out of scope for this project.

There are various query string parsing libraries already available such as qs in Node.js, or any of these here.