File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments