fast-qs
v2.1.2
Published
A lightweight library for parsing and stringifying URL query strings.
Maintainers
Readme
fast-qs
A lightweight library for parsing and stringifying URL query strings.
Documentation
For detailed usage instructions and API references, please visit the official documentation:
Quick Start
import { parse, stringify } from 'fast-qs';
// Parse a query string
const params = parse('name=John&age=30');
console.log(params); // → { name: 'John', age: '30' }
// Stringify an object
const query = stringify({ city: 'New York', country: 'USA' });
console.log(query); // → "city=New%20York&country=USA"Core Features
⚡ Key Features
| Feature | Description |
|------------------------|----------------------------------------------------------------------------|
| Custom Separators | Support any separators (e.g., parse('a|1;b|2', { sep: ';', eq: '|' }) |
| Empty Value Handling | f= → { f: '' }, &= → { '': '' } |
| Duplicate Keys | Automatically converted to arrays (e.g., a=1&a=2 → { a: ['1', '2'] } |
| Invalid Encoding | Retains invalid %xx (e.g., % → %, %A → %A |
| URL Parsing | Automatically extracts parameters after ?, supports start to specify position |
| Filter Extension | Filter/transform keys/values via filter (e.g., filter sensitive fields) |
Contributing
We welcome contributions from the community! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request.
How to Contribute
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your changes.
License
This project is licensed under the MIT License.
Browser Support
|
|
|
|
|
--- | --- | --- | --- | --- |
Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |

