The `qs-parser` package, often referred to as `QS`, provides a lightweight utility for parsing, manipulating, and reconstructing URL query strings. It enables developers to easily extract individual query parameters, retrieve all parameters as an object, and verify the existence of specific keys. The library supports dynamic modification of query strings by adding new tokens, updating existing values, or completely removing parameters. A distinctive feature is its `go()` method, which can directly navigate the browser to the newly constructed URL. It handles URL encoding/decoding automatically and performs type conversion for numbers and arrays, with array parameters requiring a `[]` suffix in their key names. The current stable version is `0.4.8`. Given the inactivity in its GitHub repository, the project appears to be abandoned, meaning there are no active developments or a defined release cadence.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This package is primarily designed for CommonJS environments. For ESM, a bundler or `import * as QS from 'qs-parser';` might be required for interoperability. The default import style shown as 'wrong' is common for ESM modules, but this package exposes its API via CommonJS module.exports.
The `QS` function is used directly as an initializer for a new instance, not as a class constructor with `new`.
When called without arguments in a browser environment, `QS()` automatically parses `window.location.search`. This behavior is not supported in Node.js where a URL string must always be provided.
This example demonstrates how to initialize `qs-parser` with a URL, perform various read operations to retrieve parameters and check their existence, and then chain multiple write operations (set, add, remove) to modify the query string. It also shows the updated `url` property on the `qs` instance.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.
No traffic data recorded yet.