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

Go
87%
MIT

Hatchet

AI Development · Automation · Developer Tools

8,174

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
67
Dependency
Built with
Go 87%
Updated yesterday
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,160

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
76
Repo Health
76
Technical
65
Dependency
Built with
TypeScript 98%
Updated 1 months ago
TypeScript
95%
AGPL 3.0

HeyForm

Forms Surveys · No Code Platforms

9,048

Open-source conversational form builder with AI generation, conditional logic, and 30+ integrations — self-host with full data ownership.

View details
86
Repo Health
67
Technical
67
Dependency
Built with
TypeScript 95%
Updated today
TypeScript
68%
MIT

Hoppscotch

Developer Tools

80,676

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
62
Dependency
Built with
TypeScript 68%
Vue 24%
Updated yesterday
TypeScript
62%
EPL-2.0

Huly Platform

Collaboration · Project Management · Team Chat

27,978

Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.

View details
90
Repo Health
86
Technical
62
Dependency
Built with
TypeScript 62%
Svelte 34%
Updated yesterday
TypeScript
100%
Apache 2.0

ILLA Builder

Design Tools · Developer Tools · Low Code Platforms

12,333

Open-source low-code platform for building internal tools with drag-and-drop UI, reactive data bindings, and real-time collaboration.

View details
55
Repo Health
71
Technical
63
Dependency
Built with
TypeScript 100%
Updated 5 months ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated today
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,629

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
45
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 3 months ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,196

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated today

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