Query string handler
Module to parse query part of the location URL.
Installation
npm install @cjssdk/query
Usage
Add to the scope:
var query = require('@cjssdk/query');
Parse some parameters:
// gives {param: '5000', another_param: 'another_value'}
// note that the type of param value is string
console.log(query.parse('param=5000&another_param=another_value'));
Parse current document query string:
console.log(query.parse(document.location.search.substring(1)));
Stringify query params:
// gives 'param=128'
console.log(query.stringify({param: 128}));
Contribution
If you have any problems or suggestions please open an issue according to the contribution rules.
License
@cjssdk/query
is released under the MIT License.