query-string-parse
a lightweight es6 utility for transforming query string parameters!Build Statusbuild-badgebuild !Code Coveragecoverage-badgecoverage !versionversion-badgepackage !downloadsdownloads-badgenpmtrends !MIT Licenselicense-badgelicense
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)