sindresorhus

sindresorhus/query-string

JavaScript MIT Web Dev

Parse and stringify URL query strings

6.9k stars
452 forks
recent
GitHub +6 / week

6.9k

Stars

452

Forks

2

Open issues

30

Contributors

v9.4.1 28 Jun 2026

AI Analysis

query-string is a mature, well-adopted npm package for parsing and stringifying URL query strings in JavaScript. It handles multiple array format conventions and serves developers building web applications or libraries that need flexible query string manipulation beyond the native URLSearchParams API. It benefits frontend and Node.js developers who require advanced parsing options.

Web Dev Library Discovery value: 2/10
Documentation 9/10
Activity 9/10
Community 9/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

url-parsing query-string npm-package javascript-utility browser-compatible
Actively maintained Well documented MIT licensed Popular Beginner friendly Production ready
Deep Analysis · Based on README and public signals
2w ago

query-string: a mature, configurable query string parser for JavaScript with broad ecosystem presence

query-string solves the practical problem of reliably parsing and stringifying URL query strings in JavaScript, including edge cases like arrays in multiple formats, type coercion, sorting, and custom separators. It targets JavaScript/Node.js developers who need more control than the native URLSearchParams API provides. With ~6,900 stars, 452 forks, and consistent npm download figures in the hundreds of millions annually, it is one of the most widely installed query string utilities in the npm ecosystem. It remains actively maintained by Sindre Sorhus as of mid-2026.

Origin

Created in November 2013, it predates native URLSearchParams support in browsers and Node.js by several years, establishing itself as the default choice for query string handling. It has evolved through multiple major versions, adding ESM-only support and new features like typed parsing.

Growth

Growth was driven primarily by ecosystem inertia — it became an indirect dependency of many popular tools and frameworks early on. Its weekly npm downloads consistently rank in the top 1% of packages. Star growth has plateaued (1 star in the past 7 days), reflecting a mature, utility-stage project where adoption is measured in downloads rather than new GitHub stars.

In production

npm download counts for query-string have historically exceeded 50-100 million downloads per week, placing it among the most widely consumed npm packages. It appears as a transitive dependency in many popular JavaScript toolchains. Direct production usage at scale is strongly implied by download volume, though individual production deployments are not individually documented.

Code analysis
Architecture

Appears to be a focused, single-purpose utility library exporting parse and stringify functions. Likely implemented as a pure ESM module (Sindre Sorhus migrated most packages to ESM-only around 2021-2022). The API surface is deliberately narrow but highly configurable via an options object, supporting multiple array serialization formats, type coercion, custom sorting, and per-key type schemas.

Tests

Not documented in README, but based on the project's maturity, sindresorhus's general practices, and the complexity of edge cases covered in the documented API, testing is likely comprehensive — though this cannot be verified from metadata alone.

Maintenance

Last push was 2026-05-29, approximately 27 days before the evaluation date. This indicates active maintenance. The project is under Sindre Sorhus's stewardship, who has a documented track record of maintaining packages long-term. No signs of abandonment.

Honest verdict

ADOPT IF: you need fine-grained control over array serialization formats, type coercion, or custom separators in query strings, and URLSearchParams falls short of your requirements. AVOID IF: your use case is simple key-value parsing — native URLSearchParams handles this without adding a dependency, and the README itself recommends that path. MONITOR IF: you depend on it as a transitive dependency in an ESM migration context, since its ESM-only nature can create issues in CommonJS-based toolchains.

Independent dimensions

Mainstream potential

3/10

Technical importance

6/10

Adoption evidence

8/10

Risks
  • ESM-only design (post v7) creates friction for CommonJS or older toolchain environments, potentially forcing version pinning or workarounds.
  • Native URLSearchParams continues to improve and may absorb more use cases over time, gradually narrowing the feature gap that justifies this dependency.
  • Single-maintainer project: Sindre Sorhus is prolific but manages hundreds of packages; bus factor risk exists even if current maintenance is good.
  • The library appears to have plateaued in star growth, which may indicate the JavaScript community is increasingly defaulting to native APIs for new projects.
  • Downstream breakage risk: because it is a transitive dependency for many packages, major version changes (like the ESM-only shift) have historically caused ecosystem disruption.
Prediction

Likely to remain a stable, maintained utility for the foreseeable future, slowly losing new adoption to native URLSearchParams in simple cases while retaining strong presence as an indirect dependency in existing codebases.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

JavaScript
95.3%
TypeScript
4.7%

Information

Language
JavaScript
License
MIT
Last updated
2w ago
Created
154mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

ljharb

ljharb/qs

qs is a mature querystring parser and serializer with nesting support for...

8.9k JavaScript Web Dev
google

google/go-querystring

go-querystring is a Go library that encodes structs into URL query strings,...

2.1k Go Dev Tools
sindresorhus

sindresorhus/got

Got is a mature, widely-adopted HTTP client library for Node.js that...

14.9k TypeScript Web Dev
47ng

47ng/nuqs

nuqs is a type-safe state manager for React that stores component state in URL...

10.7k TypeScript Web Dev
sindresorhus

sindresorhus/ky

Ky is a minimal HTTP client wrapping the Fetch API with a simpler, more...

17k TypeScript Web Dev
vs. alternatives
URLSearchParams (native)

The native browser/Node.js API handles simple cases without a dependency. query-string differentiates itself with array format options, sorting, type coercion, and more nuanced parsing behaviors. The README itself recommends URLSearchParams for simple use cases, suggesting the library is positioning itself for complex needs only.

ljharb/qs

qs (8,941 stars) is the closest functional competitor, popular in Express.js ecosystems. qs supports nested objects via bracket notation more deeply; query-string focuses more on explicit array format flexibility and ESM-first design. Both are mature and widely used; choice often depends on framework conventions.

47ng/nuqs

nuqs (10,601 stars) targets a completely different use case: type-safe URL state management in React/Next.js. It operates at a higher abstraction level. Not a direct substitute for query-string's low-level parsing utility.

sindresorhus/ky

ky is an HTTP client, not a query string parser. Listed as a similar repo likely because of shared authorship and common usage in frontend projects, but it solves a different problem.

google/go-querystring

A Go library for encoding structs into query strings — entirely different language and use case. Not a meaningful competitor in the JavaScript ecosystem.