Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
A querystring parser that supports nesting and arrays, with a depth limit
Weekly downloads
Package description
The qs package is a query string parsing and stringifying library with some added security. It is often used to parse and stringify query strings, handling complex data structures within query strings.
Parsing query strings
This feature allows you to convert a query string into an object, making it easy to access the values.
const qs = require('qs');
const query = qs.parse('a=c&b=d');
console.log(query); // { a: 'c', b: 'd' }
Stringifying objects
This feature enables you to take an object and convert it into a query string, which can be used in URLs.
const qs = require('qs');
const stringified = qs.stringify({ a: 'c', b: 'd' });
console.log(stringified); // 'a=c&b=d'
Handling arrays and objects
qs can parse and stringify nested objects and arrays, allowing for complex data structures in query strings.
const qs = require('qs');
const query = qs.parse('a[]=b&a[]=c');
console.log(query); // { a: ['b', 'c'] }
Custom parsing options
You can customize the parsing behavior by providing options such as delimiters, allowing for flexibility in the format of query strings.
const qs = require('qs');
const query = qs.parse('a=c&b=d', { delimiter: ';' });
console.log(query); // { 'a=c&b=d': '' }
query-string is a robust library for parsing and stringifying URL query strings. It is designed to be simpler than qs and does not support nested objects, but it is tree-shakable and can be used in both Node.js and the browser.
url-search-params is a polyfill for the URLSearchParams API, which is a native web API for handling query strings. It is not as feature-rich as qs, but it provides a standard way for parsing and stringifying query strings in the browser.
FAQs
A querystring parser that supports nesting and arrays, with a depth limit
The npm package qs receives a total of 57,280,507 weekly downloads. As such, qs popularity was classified as popular.
We found that qs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.