
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
fast-querystring
Advanced tools
Fast query-string parser to replace the legacy `node:querystring` parse & stringify functions.
Fast query-string parser to replace the legacy node:querystring
parse & stringify functions.
npm i fast-querystring
parse
and stringify
methods from node:querystring
module&
separator as defaultstring
foo=bar&foo=baz
parses into {foo: ['bar', 'baz']}
foo=bar&hola
parses into {foo: 'bar', hola: ''}
node:querystring
)const qs = require('fast-querystring')
// Parsing a querystring
console.log(qs.parse('hello=world&foo=bar&values=v1&values=v2'))
// {
// hello: 'world',
// foo: 'bar',
// values: ['v1', 'v2']
// }
// Stringifying an object
console.log(qs.stringify({ foo: ['bar', 'baz'] }))
// 'foo=bar&foo=baz'
> node benchmark/parse.mjs
╔═════════════════════════════════════════╤═════════╤═══════════════════╤═══════════╗
║ Slower tests │ Samples │ Result │ Tolerance ║
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
║ qs │ 10000 │ 317841.53 op/sec │ ± 1.18 % ║
║ query-string │ 10000 │ 341009.91 op/sec │ ± 1.06 % ║
║ querystringify │ 1000 │ 451609.79 op/sec │ ± 0.61 % ║
║ @aws-sdk/querystring-parser │ 1000 │ 477241.09 op/sec │ ± 0.69 % ║
║ URLSearchParams-with-Object.fromEntries │ 10000 │ 870095.07 op/sec │ ± 3.29 % ║
║ URLSearchParams-with-construct │ 10000 │ 1232650.60 op/sec │ ± 2.95 % ║
║ node:querystring │ 10000 │ 1462802.04 op/sec │ ± 3.69 % ║
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
║ Fastest test │ Samples │ Result │ Tolerance ║
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
║ fast-querystring │ 10000 │ 1809816.84 op/sec │ ± 3.19 % ║
╚═════════════════════════════════════════╧═════════╧═══════════════════╧═══════════╝
> node benchmark/stringify.mjs
╔════════════════════════════╤═════════╤═══════════════════╤═══════════╗
║ Slower tests │ Samples │ Result │ Tolerance ║
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
║ query-string │ 10000 │ 284130.63 op/sec │ ± 1.62 % ║
║ qs │ 10000 │ 334799.48 op/sec │ ± 1.93 % ║
║ http-querystring-stringify │ 10000 │ 482642.49 op/sec │ ± 1.72 % ║
║ URLSearchParams │ 10000 │ 587274.65 op/sec │ ± 1.88 % ║
║ querystringify │ 10000 │ 753960.35 op/sec │ ± 2.20 % ║
║ node:querystring │ 10000 │ 1796993.95 op/sec │ ± 5.34 % ║
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
║ Fastest test │ Samples │ Result │ Tolerance ║
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
║ fast-querystring │ 10000 │ 2051022.89 op/sec │ ± 4.52 % ║
╚════════════════════════════╧═════════╧═══════════════════╧═══════════╝
FAQs
A fast alternative to legacy querystring module
We found that fast-querystring demonstrated a not healthy version release cadence and project activity because the last version was released 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.