query-string
npmv9.5.1TypeScriptParse and stringify URL query strings
Safe to adopt
Yes — query-string scores well across adoption, maintenance, weight, supply chain, and licensing. 22.1M downloads per week and 3 known dependents. Last published 8 days ago. 11 releases in the last 2 years.
- AAdoption: grade A, Excellent.
22.1M downloads per week and 3 known dependents.
- AMaintenance: grade A, Excellent.
Last published 8 days ago. 11 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 3 transitive packages, about 77 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding query-string to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing query-string, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=18
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the query-string README.
import queryString from 'query-string';
console.log(location.search);
//=> '?foo=bar'
const parsed = queryString.parse(location.search);
console.log(parsed);
//=> {foo: 'bar'}
console.log(location.hash);
//=> '#token=bada55cafe'
const parsedHash = queryString.parse(location.hash);
console.log(parsedHash);query-string vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| query-stringthis page | 22.1M | 3 | MIT | 8 days ago |
| qs | 0 | 4 | BSD-3-Clause | 1 day ago |
| @nodable/entities | 0 | 2 | MIT | 1 day ago |
| encodeurl | 133.6M | 5 | MIT | 1 day ago |
| open | 130.4M | 4 | MIT | 1 day ago |
| html-escaper | 79.8M | 1 | MIT | 1 day ago |
Dependencies
Declared by query-string v9.5.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (6)
Used by
Popular packages that depend on query-string.
The official, opinionated, batteries-included toolset for efficient Redux development
A fast alternative to legacy querystring module
Expo Router is a file-based router for React Native and web applications.
Relationship graph
Dependencies (left) and dependents (right) of query-string.
Frequently installed together
Native navigation primitives for your React Native app.
Declarative API exposing native platform touch and gesture system to React Native
Tools for making advanced Metro bundler features work
Simple and complete React Native testing utilities that encourage good testing practices.
React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.
More powerful alternative to Animated library for React Native.
React Native for Web
The Expo SDK
Error overlay for universal Expo apps.
React is a JavaScript library for building user interfaces.
TypeScript definitions for node
React package for working with the DOM.
Release history
10 releases in the last two years, typically about 26 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 9.5.1latest | 8 days ago | 58 KB | MIT |
| 9.5.0 | 1 month ago | 58 KB | MIT |
| 9.4.1 | 2 months ago | 58 KB | MIT |
| 9.4.0 | 3 months ago | 58 KB | MIT |
| 9.3.1 | 11 months ago | 56 KB | MIT |
| 9.3.0 | 1 year ago | 55 KB | MIT |
| 9.2.2 | 1 year ago | 52 KB | MIT |
| 9.2.1 | 1 year ago | 52 KB | MIT |
| 9.2.0 | 1 year ago | 52 KB | MIT |
| 9.1.2 | 1 year ago | 50 KB | MIT |
| 9.1.1 | 1 year ago | 50 KB | MIT |
| 9.1.0 | 2 years ago | 51 KB | MIT |
| 9.0.0 | 2 years ago | 45 KB | MIT |
| 8.2.0 | 2 years ago | 45 KB | MIT |
| 8.1.0 | 3 years ago | 45 KB | MIT |
Overview
query-string is an npm package that parse and stringify URL query strings. It is extremely widely used, with about 22.1M downloads per week and 3 known dependents in the graph. The latest version is 9.5.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need parse and stringify URL query strings and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (22.1M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use query-string?
Yes — query-string scores well across adoption, maintenance, weight, supply chain, and licensing. 22.1M downloads per week and 3 known dependents. Last published 8 days ago. 11 releases in the last 2 years.
How do I install query-string?
Run `npm install query-string` to add query-string to your npm project.
How many dependencies does query-string have?
query-string declares 9 direct dependencies and pulls in 3 packages in total once its runtime tree is resolved totalling about 77 KB on disk.
What license is query-string released under?
query-string is distributed under the MIT license.
How popular is query-string?
query-string has approximately 22,114,781 downloads per week and 3 known dependent packages.
Is query-string still maintained?
The most recent release of query-string (v9.5.1) was published 8 days ago.
Does query-string run install scripts?
No. query-string does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.