Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cjs-query

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjs-query

Parse the given location search string into object.

  • 1.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 04 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc