1.1.1 • Published 6 years ago

query-string-parse v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

query-string-parse

a lightweight es6 utility for transforming query string parameters

Build Status Code Coverage version downloads MIT License

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)