cjs-query

1.5.1 • Public • Published

Query string handler

build status npm version dependencies status devDependencies status Gitter RunKit

Module to parse query part of the location URL.

Installation

npm install cjs-query

Usage

Add to the scope:

var query = require('cjs-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

cjs-query is released under the MIT License.

/cjs-query/

    Package Sidebar

    Install

    npm i cjs-query

    Weekly Downloads

    3

    Version

    1.5.1

    License

    MIT

    Unpacked Size

    4.66 kB

    Total Files

    4

    Last publish

    Collaborators

    • cjssdk