query-string-parse
v1.1.1
Published
a helpful utility for transforming query string parameters
Downloads
17
Maintainers
Readme
query-string-parse
a lightweight es6 utility for transforming query string parameters
more documentation is coming soon 😀
Usage
import { parser } from "query-string-parse";
// to get query params from url use
// const input = window.location.search
const input = "?valueOne=one&valueTwo=two";
const queryStrings = parser(input);
// will return
// { valueOne: "one", valueTwo: "two" }
Please feel free to raise issues and remember to star this repo!
Thanks!
Current functionality
- handles query string with leading '?'
- handles query string without leading '?'
- ensures input is valid (type === string)