Skip to content

cjssdk/query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Parse the given location search string into object.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published