A lightweight library for parsing and stringifying URL query strings.
npm install fast-qs



> A lightweight library for parsing and stringifying URL query strings.
---
For detailed usage instructions and API references, please visit the official documentation:
---
``typescript
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"
`
---
|
| 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) |---
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.
---
This project is licensed under the MIT License.
---
!Chrome | !Firefox | !Safari | !Opera | !Edge |
--- | --- | --- | --- | --- |
Latest ā | Latest ā | Latest ā | Latest ā | Latest ā |