Skip to content

Announcing QueryStringJS

⚠ This package is now deprecated ⚠

Use URLSearchParams instead.


I made a JavaScript query string parsing library because all the others sucked.

It's on NPM.

It has unit tests!

And it's pretty simple to use (example uses browserify):

var QueryString = require("querystringjs")(/* optional options go here */);
// {"foo":"bar"}

console.log(QueryString.stringify({ foo: "bar" }));
// "foo=bar"

And most importantly, it handles the things that most other solutions don't even think about:

// {"foo": "bar baz"}

// {"": ""}

// {"foo": ["bar", "baz"]}

// and many more!

So stop using whatever broken methods you've been using for query string parsing and start using this instead!