qs

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

Library
npm
v6.16.1
8,948 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
74 /100 Good
Development Activity 84
Maintenance 40
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 82
Code Quality 88
Innovation 75
Learning Curve 70

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 49 apps in this directory

Java
70%
GPL 3.0

DataEase

AI Assistants · Analytics · Data Engineering

24,626

Open-source BI tool with drag-and-drop dashboards, 20+ data source connectors, and AI-powered natural language queries — a self-hosted alternative to Tableau.

View details
94
Repo Health
71
Technical
65
Dependency
Built with
Java 70%
Vue 29%
Updated yesterday
Rust
67%
Other

DefGuard

Authentication · Networking · Security

2,882

Self-hosted secure remote access that unifies WireGuard VPN, identity management, and connection-level MFA in one open-source platform.

View details
86
Repo Health
82
Technical
71
Dependency
Built with
Rust 67%
TypeScript 30%
Updated yesterday
Python
56%
Other

Dify

AI Development · Design Tools · Developer Tools

159,396

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
67
Dependency
Built with
Python 56%
TypeScript 42%
Updated today
TypeScript
80%
Other

Directus

CMS · Low Code Platforms

38,629

Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.

View details
93
Repo Health
82
Technical
76
Dependency
Built with
TypeScript 80%
Vue 19%
Updated yesterday
TypeScript
91%
MIT

Dittofeed

Automation · Marketing

3,022

Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.

View details
72
Repo Health
75
Technical
62
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago
TypeScript
91%
Other

FastGPT

AI Agents · AI Development

29,900

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
66
Dependency
Built with
TypeScript 91%
Updated today
TypeScript
74%
Apache 2.0

Fern

Developer Tools

3,822

Fern turns a single OpenAPI, AsyncAPI, or Protobuf definition into type-safe SDKs for nine languages and a hosted API documentation site, all from one CLI and one source of truth.

View details
90
Repo Health
86
Technical
66
Dependency
Built with
TypeScript 74%
Updated today
TypeScript
63%
MIT

Ghost

Blogging · CMS

55,598

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 63%
JavaScript 35%
Updated yesterday
Go
62%
Apache 2.0

Harness Open Source

Code Editors · Developer Tools · Devops

38,684

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
90
Repo Health
79
Technical
64
Dependency
Built with
Go 62%
TypeScript 33%
Updated yesterday

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