Skip to content

Commit 08a1509

Browse files
committed
docs: update features and usage
1 parent d89d1ed commit 08a1509

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,32 @@ npm i fast-querystring
1010

1111
### Features
1212

13+
- Supports both `parse` and `stringify` methods from `node:querystring` module
1314
- Parsed object does not have prototype methods
1415
- Uses `&` separator as default
1516
- Supports only input of type `string`
1617
- Supports repeating keys in query string
1718
- `foo=bar&foo=baz` parses into `{foo: ['bar', 'baz']}`
1819
- Supports pairs with missing values
1920
- `foo=bar&hola` parses into `{foo: 'bar', hola: ''}`
21+
- Stringify does not support nested values (just like `node:querystring`)
2022

2123
### Usage
2224

2325
```javascript
24-
const QueryString = require('fast-querystring')
25-
const qs = QueryString.parse('hello=world&foo=bar&values=v1&values=v2')
26+
const qs = require('fast-querystring')
2627

27-
console.log(qs)
28+
// Parsing a querystring
29+
console.log(qs.parse('hello=world&foo=bar&values=v1&values=v2'))
2830
// {
2931
// hello: 'world',
3032
// foo: 'bar',
3133
// values: ['v1', 'v2']
3234
// }
35+
36+
// Stringifying an object
37+
console.log(qs.stringify({ foo: ['bar', 'baz'] }))
38+
// 'foo=bar&foo=baz'
3339
```
3440

3541
### Benchmark

0 commit comments

Comments
 (0)