qs

A battle-tested querystring parser and serializer for Node.js with nested object support and built-in security limits.

Library
npm
v6.15.3
8,943stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
68/100Good
Development Activity64
Maintenance36
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture82
Code Quality88
Innovation75
Learning Curve70

qs is the querystring parsing and stringifying library that powers Express’s built-in query parser and countless other Node.js HTTP stacks. It goes beyond the built-in querystring module by supporting nested objects and arrays through bracket notation (foo[bar][baz]=x), configurable array formats, and dot notation, while still round-tripping cleanly between parse and stringify.

Because qs sits directly in the path of untrusted user input, the maintainers have hardened it against parameter-pollution and prototype-pollution attacks with tunable limits — depth, parameterLimit, arrayLimit — and a strictDepth/throwOnLimitExceeded mode that turns silent truncation into explicit errors. It has minimal runtime dependencies and remains one of the most widely depended-upon packages in the npm ecosystem.

What You Get

  • parse() and stringify() functions for converting between query strings and JavaScript objects
  • Nested object and array support via bracket notation (a[b][c]=d) and optional dot notation
  • Configurable limits (depth, parameterLimit, arrayLimit) with a throwOnLimitExceeded mode for defending against malicious input
  • Multiple array serialization formats (indices, brackets, repeat, comma) for compatibility with different backend expectations
  • iso-8859-1 and utf-8 charset handling, including sentinel-based auto-detection for legacy form submissions

Common Use Cases

  • Parsing incoming query strings in Express, Connect, or other Node.js HTTP servers
  • Serializing complex filter/sort/pagination state into a URL for client-side routing
  • Round-tripping nested API request parameters without a full JSON body
  • Sanitizing and bounding untrusted query input to prevent prototype-pollution or resource-exhaustion attacks

Under The Hood

Architecture qs is split into four small, single-purpose modules under lib/: parse.js walks a raw query string into a flat key-list via parseValues, then parseKeys/parseObject recursively expand bracket-notation keys (e.g. a[b][c]) into a nested object up to the configured depth, falling back to a flattened remainder key once that depth is exceeded. stringify.js performs the inverse walk, recursing over an arbitrary JS value and joining key/value pairs with a configurable delimiter, while utils.js provides the shared encode/decode, compact (sparse-array cleanup), and merge (safe object-merging that explicitly special-cases prototype pollution) primitives that both directions depend on. formats.js is a two-entry lookup for RFC1738 vs RFC3986 percent-encoding. There is no class hierarchy or plugin system — the whole library is a handful of composed functions gated by an options object, and index.js simply re-exports parse, stringify, and formats.

Tech Stack Written in plain ES5-style JavaScript ('use strict', var throughout, no build-time transpilation of the published code) targeting Node >=0.6 per package.json engines. Runtime dependencies are minimal and defensive: es-define-property (a Object.defineProperty cross-engine shim) and side-channel (an out-of-band WeakMap-style store used to track array-overflow state without mutating user objects). The dev toolchain uses browserify plus common-shakeify/bundle-collapser to produce a standalone browser bundle in dist/, tape with nyc for tests and coverage, and eslint with @ljharb/eslint-config for linting; CI (.github/workflows/) runs the test matrix down to Node versions below 10, reflecting the maintainer’s (ljharb) broader ecosystem commitment to very wide Node-version compatibility.

Code Quality Test coverage is extensive relative to the library’s size: test/parse.js (1933 lines), test/stringify.js (1678 lines), and test/utils.js (626 lines) exercise edge cases exhaustively — sparse arrays, prototype-pollution attempts, charset sentinels, depth/parameter/array-limit boundaries, and round-trip parse/stringify symmetry. npm test chains a README doctest runner (evalmd) with lint and coverage-gated tape runs, and posttest runs npm audit against production dependencies. Naming is consistent and functions are kept short and single-purpose; there is no TypeScript, but the small, stable public surface (parse, stringify, formats) limits the practical cost of that.

API Design The public API is deliberately tiny — two functions (parse, stringify) each taking a value and an options object — which keeps the zero-config path (qs.parse('a=c')) trivial while still exposing dozens of well-documented options (allowDots, arrayLimit, charsetSentinel, duplicates, etc.) for advanced tuning. The README is unusually thorough for an npm package, walking through every option with runnable, asserted code examples, which both documents behavior and doubles as the test suite via evalmd. The main friction point for newcomers is the sheer number of options and the security-relevant defaults (e.g. arrayLimit: 20, depth: 5) that silently reshape output unless understood upfront — a deliberate trade-off favoring safety over surprise-free flexibility.

Used by 48 apps in this directory

Go
72%
GPL 3.0

1Panel

Devops · Hosting Control Panel · Monitoring

36,573

The only open-source VPS control panel with native AI agent runtime — deploy websites, Docker stacks, and local LLMs from one web interface.

View details
91
Repo Health
76
Technical
67
Dependency
Built with
Go72%
Vue28%
Updated today
TypeScript
99%
Other

Activepieces

Automation · AI Assistants

23,887

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
65
Dependency
Built with
TypeScript99%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Other

Akaunting

Invoicing Finance

10,070

Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.

View details
98
Repo Health
73
Technical
63
Dependency
Updated yesterday
Go
60%
Apache 2.0

Apache Answer

Community

15,652

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
85
Repo Health
78
Technical
69
Dependency
Built with
Go60%
TypeScript36%
Updated 2 days ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,846

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript97%
Updated yesterday
TypeScript
100%
MIT

Botpress

AI Assistants · AI Development · Customer Support

14,872

The open-source hub for building and deploying LLM-powered AI agents with TypeScript-first tooling, 40+ integrations, and a revolutionary code-execution agent framework.

View details
95
Repo Health
82
Technical
66
Dependency
Built with
TypeScript100%
Updated yesterday
Go
52%
MIT

Bytebase

Devops

14,396

An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.

View details
92
Repo Health
73
Technical
69
Dependency
Built with
Go52%
TypeScript39%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search