2.0.0 • Published 8 years ago

ln-parse-query v2.0.0

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

ln-parse-query

Parse a given query strning into its equivalent object.

Installing

npm install --save ln-parse-query

Using

Just load the module and call the parser.

const parser = require("ln-parse-query");

parser("hello=goodbye&foo=bar%20all%20day&novalue");
/*
* {
*   hello: "goodbye",
*   foo: "bar all day",
*   novalue: ""
* }
*/

The module removes trailing '?' or '#' so that it can be used in the browser with window.location.hash or window.location.search