Skip to content

Commit

Permalink
docs: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Sep 3, 2022
1 parent 58e9592 commit b5aed6e
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# fast-querystring

Fast query-string parser to replace the deprecated `node:querystring` parse function.

### Installation

```
npm i --save fast-querystring
```

### Usage

```javascript
const QueryString = require('fast-querystring')
const qs = QueryString.parse('hello=world&foo=bar&values=v1&values=v2')

console.log(qs)
// {
// hello: 'world',
// foo: 'bar',
// values: ['v1', 'v2']
// }
```

### Benchmark

```
> [email protected] benchmark
> node test/benchmark.mjs
╔══════════════════╤═════════╤═══════════════════╤═══════════╤══════════════════════════╗
║ Slower tests │ Samples │ Result │ Tolerance │ Difference with previous ║
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
║ qs │ 10000 │ 690970.02 op/sec │ ± 2.62 % │ ║
║ query-string │ 10000 │ 728597.61 op/sec │ ± 3.27 % │ + 5.45 % ║
║ URLStateMachine │ 10000 │ 782804.78 op/sec │ ± 2.19 % │ + 7.44 % ║
║ node:querystring │ 10000 │ 3225895.94 op/sec │ ± 7.42 % │ + 312.09 % ║
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
║ Fastest test │ Samples │ Result │ Tolerance │ Difference with previous ║
╟──────────────────┼─────────┼───────────────────┼───────────┼──────────────────────────╢
║ fast-querystring │ 10000 │ 3499113.15 op/sec │ ± 4.37 % │ + 8.47 % ║
╚══════════════════╧═════════╧═══════════════════╧═══════════╧══════════════════════════╝
```

0 comments on commit b5aed6e

Please sign in to comment.