ln-parse-query

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i ln-parse-query

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • lindsor