query-string

Parse and stringify URL query strings in JavaScript with flexible array, number, and boolean handling.

Library
npm
v10.0.0
6,904 stars
MIT License

Repository Health

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

Technical Analysis

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

query-string is a small, dependency-light JavaScript library for parsing and stringifying URL query strings. It turns a ?foo=bar&baz=1 string into a plain object and back again, handling the messy edge cases that the raw URLSearchParams API leaves to you: multiple array-encoding conventions, optional number and boolean coercion, custom per-key type schemas, sorted output, and helpers that operate on full URLs including the hash fragment.

Widely used across the front-end ecosystem with tens of millions of weekly downloads, it works identically in modern browsers and Node.js, ships first-class TypeScript types, and exposes a tiny, predictable API surface centered on parse and stringify.

What You Get

  • parse and stringify functions that convert between query strings and plain objects
  • Six array-encoding formats (bracket, index, comma, separator, bracket-separator, colon-list-separator) plus the default duplicate-key style
  • Optional coercion of values to numbers and booleans, or explicit per-key type schemas including custom transform functions
  • URL-aware helpers parseUrl and stringifyUrl that preserve the path and hash fragment
  • pick and exclude helpers for filtering parameters, and bundled TypeScript type definitions

Common Use Cases

  • Reading and updating filter, sort, and pagination state stored in the URL of a single-page app
  • Serializing request parameters into query strings for HTTP calls
  • Normalizing array parameters between a frontend and an API that uses a specific bracket or comma convention
  • Parsing OAuth or token data passed back in a URL hash fragment

Under The Hood

Architecture

The entire library lives in base.js (~600 lines), re-exported through a tiny index.js that presents a default namespace object. Seven public functions — extract, parse, stringify, parseUrl, stringifyUrl, pick, and exclude — are built around internal encoderForArrayFormat and parserForArrayFormat factories that return the right encode/decode reducer for the chosen arrayFormat. parse splits pairs on &, uses split-on-first to divide each on its first =, decodes with decode-uri-component, folds results through the array reducer, and returns a prototype-less object via Object.create(null); stringify runs the inverse, and the URL helpers wrap these while carrying the path and hash fragment.

Tech Stack

Written in modern ESM JavaScript targeting Node.js >=18 ("type": "module"), with three tiny single-purpose runtime dependencies: decode-uri-component, filter-obj, and split-on-first. Types ship as hand-written .d.ts files (base.d.ts, index.d.ts). Tooling is xo for linting, ava for tests, tsd for type tests, and a benchmark script.

Code Quality

The code is clean and consistent, favoring small pure helpers and switch-based strategy selection over branching sprawl. Test coverage is thorough: a dedicated test/ directory holds separate suites for parse, stringify, parse-url, stringify-url, extract, pick, exclude, and property-based tests via fast-check, alongside index.test-d.ts type assertions. Edge cases around null, undefined, empty strings, and encoding are handled explicitly throughout.

API Design The developer experience is a strong point: the surface is minimal and memorable (parse/stringify mirror JSON), options are plain objects with sensible defaults, and the README documents every array format and type option with runnable examples. Full TypeScript definitions and isomorphic browser/Node behavior mean almost no boilerplate to get started, though the many arrayFormat variants require reading the docs to pick the right convention.

Used by 27 apps in this directory

TypeScript
97%
Other

Rocket.Chat

Team Chat

46,304

The secure, self-hosted team communications platform for organizations that cannot compromise on data sovereignty.

View details
96
Repo Health
79
Technical
63
Dependency
Built with
TypeScript 97%
Updated 2 days ago
TypeScript
100%
AGPL 3.0

RSSHub

Automation · Social Media

46,631

Turn any website into an RSS feed — social media, streaming platforms, and niche sites all become subscribable in seconds.

View details
94
Repo Health
82
Technical
71
Dependency
Built with
TypeScript 100%
Updated 2 days ago
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

45,632

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python 57%
TypeScript 42%
Updated 2 days ago
TypeScript
98%
MIT

sigle

Blogging

489

A decentralized, open-source writing platform that permanently stores your stories on the Stacks blockchain and Arweave — where Web3 content creators own their words forever.

View details
81
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Go
66%
GPL 3.0

Stormkit

Devops · Hosting Control Panel

264

Self-hostable platform for deploying and hosting modern web apps with automated CI/CD, custom domains, and a built-in serverless runtime — a true open-source alternative to Vercel and Netlify.

View details
80
Repo Health
79
Technical
67
Dependency
Built with
Go 66%
TypeScript 31%
Updated 3 days ago
TypeScript
91%
MIT

Super Productivity

Productivity · Project Management

23,103

A privacy-respecting, local-first task manager with built-in timeboxing, Pomodoro timer, and deep integrations for Jira, GitHub, GitLab, and CalDAV — no accounts, no data collection, ever.

View details
91
Repo Health
81
Technical
69
Dependency
Built with
TypeScript 91%
Updated 2 days ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,123

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 2 days ago
Go
94%
MIT

Traefik

Automation · Devops · Security

65,344

A cloud-native reverse proxy and load balancer that auto-configures itself from Docker, Kubernetes, and other orchestrators — zero manual routing required.

View details
93
Repo Health
85
Technical
64
Dependency
Built with
Go 94%
Updated 3 days ago
TypeScript
90%
AGPL 3.0

useSend

Developer Tools · Marketing

4,753

Self-hostable open source email platform built on Amazon SES with a full dashboard, SMTP relay, REST API, and multi-language SDKs.

View details
76
Repo Health
72
Technical
68
Dependency
Built with
TypeScript 90%
Updated 1 weeks 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