Querystringify is a lightweight and straightforward utility for parsing and stringifying URL query strings. Currently at version 2.2.0, its last publish was approximately six years ago, suggesting a maintenance or stable status with infrequent updates. It prioritizes simplicity over handling complex, deeply nested query string structures, explicitly advising users against using it for such scenarios. Unlike more feature-rich alternatives like `qs` or `query-string`, `querystringify` focuses on basic key-value pairs without extensive type conversion or array handling beyond simple repetition. Its primary differentiator is its minimal footprint and direct approach, making it suitable for environments where bundle size and strict query string interpretation are paramount. It was developed before `URLSearchParams` became widely available, offering a basic, compatible interface for both server and client-side usage via CommonJS.
npm install querystringifyVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic parsing of query strings with and without values, and stringifying objects with optional prefixes.
For complex query string structures, consider more robust libraries like `qs` or `query-string`, or the native `URLSearchParams` API for simpler cases.
Use `const qs = require('querystringify');` for Node.js environments. For browser or modern environments, use a bundler (like Webpack, Rollup, Parcel) to handle CJS modules, or switch to a package with explicit ESM support.Evaluate if `new URLSearchParams(window.location.search)` for parsing or `new URLSearchParams({ key: 'value' }).toString()` for stringifying meets your needs before opting for external libraries.Change your import statement to `const qs = require('querystringify');` to use the CommonJS module.If nested object parsing is required, switch to a library like `qs` (often referred to as 'node-qs' or just 'qs') which explicitly handles such structures, or manually parse the resulting flat object.
For consistent array serialization using `[]` notation (e.g., `arr[]=1&arr[]=2`), use a library like `qs` or `query-string`, which offer explicit `arrayFormat` options.
No dependency data recorded yet.