https://github.com/plesiecki/tiny-search-params
Tiny (~300b) and ultra fast query-string like utility
https://github.com/plesiecki/tiny-search-params
npm-package parse query-parser query-string stringify urlsearchparams
Last synced: 9 months ago
JSON representation
Tiny (~300b) and ultra fast query-string like utility
- Host: GitHub
- URL: https://github.com/plesiecki/tiny-search-params
- Owner: plesiecki
- Created: 2019-03-08T14:35:33.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-10T13:30:18.000Z (almost 7 years ago)
- Last Synced: 2025-03-22T12:11:45.721Z (9 months ago)
- Topics: npm-package, parse, query-parser, query-string, stringify, urlsearchparams
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tiny-search-params
> Tiny (~300b) and ultra fast query-string like utility
## Installation
```sh
npm i tiny-search-params
```
## Usage
```js
import {parse, stringify} from 'tiny-search-params '
stringify({ foo: 1, bar: [2, 3] })
//=> foo=1&bar=2&bar=3
parse('foo=1&bar=2&bar=3')
//=> { foo: '1', bar: ['2', '3'] }
```
## Benchmark
```
$ node benchmark-parse.js
[bench] ale-url-parser x 19,291 ops/sec ±2.01% (85 runs sampled)
[bench] url x 9,033 ops/sec ±3.38% (81 runs sampled)
[bench] query-string x 8,484 ops/sec ±1.50% (83 runs sampled)
[bench] fast-url-parser x 21,066 ops/sec ±1.16% (89 runs sampled)
[bench] tiny-search-params x 22,603 ops/sec ±1.35% (86 runs sampled)
[bench] Fastest is url-params
```