Skip to content

Commit b5aed6e

Browse files
committed
docs: add readme
1 parent 58e9592 commit b5aed6e

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# fast-querystring
2+
3+
Fast query-string parser to replace the deprecated `node:querystring` parse function.
4+
5+
### Installation
6+
7+
```
8+
npm i --save fast-querystring
9+
```
10+
11+
### Usage
12+
13+
```javascript
14+
const QueryString = require('fast-querystring')
15+
const qs = QueryString.parse('hello=world&foo=bar&values=v1&values=v2')
16+
17+
console.log(qs)
18+
// {
19+
// hello: 'world',
20+
// foo: 'bar',
21+
// values: ['v1', 'v2']
22+
// }
23+
```
24+
25+
### Benchmark
26+
27+
```
28+
> fast-querystring@0.1.0 benchmark
29+
> node test/benchmark.mjs
30+
31+
╔══════════════════╤═════════╤═══════════════════╤═══════════╤══════════════════════════╗
32+
║ Slower tests │ Samples │ Result │ Tolerance │ Difference with previous ║
33+
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
34+
║ qs │ 10000 │ 690970.02 op/sec │ ± 2.62 % │ ║
35+
║ query-string │ 10000 │ 728597.61 op/sec │ ± 3.27 % │ + 5.45 % ║
36+
║ URLStateMachine │ 10000 │ 782804.78 op/sec │ ± 2.19 % │ + 7.44 % ║
37+
║ node:querystring │ 10000 │ 3225895.94 op/sec │ ± 7.42 % │ + 312.09 % ║
38+
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
39+
║ Fastest test │ Samples │ Result │ Tolerance │ Difference with previous ║
40+
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
41+
║ fast-querystring │ 10000 │ 3499113.15 op/sec │ ± 4.37 % │ + 8.47 % ║
42+
╚══════════════════╧═════════╧═══════════════════╧═══════════╧══════════════════════════╝
43+
```

0 commit comments

Comments
 (0)