{"id":13524008,"url":"https://github.com/anonrig/fast-querystring","last_synced_at":"2025-05-15T15:02:47.400Z","repository":{"id":58740903,"uuid":"532342875","full_name":"anonrig/fast-querystring","owner":"anonrig","description":"A 45% faster alternative to node:querystring module ","archived":false,"fork":false,"pushed_at":"2024-07-09T16:02:42.000Z","size":304,"stargazers_count":264,"open_issues_count":3,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T00:06:17.834Z","etag":null,"topics":["javascript","nodejs","parse","qs","querystring","stringify"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/fast-querystring","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anonrig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["anonrig"]}},"created_at":"2022-09-03T18:29:27.000Z","updated_at":"2025-03-26T01:36:11.000Z","dependencies_parsed_at":"2024-01-13T22:24:49.893Z","dependency_job_id":"7e7084b2-d58d-44a9-be43-f188cc74cf69","html_url":"https://github.com/anonrig/fast-querystring","commit_stats":{"total_commits":159,"total_committers":5,"mean_commits":31.8,"dds":0.2704402515723271,"last_synced_commit":"9dcbaf28ce67ce64c3d47ee4549f7ce2f8f41205"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Ffast-querystring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Ffast-querystring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Ffast-querystring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anonrig%2Ffast-querystring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anonrig","download_url":"https://codeload.github.com/anonrig/fast-querystring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248478161,"owners_count":21110648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","nodejs","parse","qs","querystring","stringify"],"created_at":"2024-08-01T06:01:06.099Z","updated_at":"2025-04-11T20:38:45.639Z","avatar_url":"https://github.com/anonrig.png","language":"JavaScript","readme":"# fast-querystring\n\n![Test](https://github.com/anonrig/fast-querystring/workflows/test/badge.svg)\n[![codecov](https://codecov.io/gh/anonrig/fast-querystring/branch/main/graph/badge.svg?token=4ZDJA2BMOH)](https://codecov.io/gh/anonrig/fast-querystring)\n[![NPM version](https://img.shields.io/npm/v/fast-querystring.svg?style=flat)](https://www.npmjs.com/package/fast-querystring)\n\nFast query-string parser and stringifier to replace the legacy `node:querystring` module.\n\n### Installation\n\n```\nnpm i fast-querystring\n```\n\n### Features\n\n- Supports both `parse` and `stringify` methods from `node:querystring` module\n- Parsed object does not have prototype methods\n- Uses `\u0026` separator as default\n- Supports only input of type `string`\n- Supports repeating keys in query string\n  - `foo=bar\u0026foo=baz` parses into `{foo: ['bar', 'baz']}`\n- Supports pairs with missing values\n  - `foo=bar\u0026hola` parses into `{foo: 'bar', hola: ''}`\n- Stringify does not support nested values (just like `node:querystring`)\n\n### Usage\n\n```javascript\nconst qs = require('fast-querystring')\n\n// Parsing a querystring\nconsole.log(qs.parse('hello=world\u0026foo=bar\u0026values=v1\u0026values=v2'))\n// {\n//   hello: 'world',\n//   foo: 'bar',\n//   values: ['v1', 'v2']\n// }\n\n// Stringifying an object\nconsole.log(qs.stringify({ foo: ['bar', 'baz'] }))\n// 'foo=bar\u0026foo=baz'\n```\n\n### Benchmark\n\nAll benchmarks are run using Node.js v20.2.0 running on M1 Max.\n\n- Parsing a query-string\n\n```\n\u003e node benchmark/parse.mjs\n\n╔═════════════════════════════════════════╤═════════╤═══════════════════╤═══════════╗\n║ Slower tests                            │ Samples │            Result │ Tolerance ║\n╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ query-string                            │   10000 │  273968.62 op/sec │  ± 1.48 % ║\n║ qs                                      │    9999 │  324118.68 op/sec │  ± 0.99 % ║\n║ querystringify                          │    1000 │  410157.64 op/sec │  ± 0.68 % ║\n║ @aws-sdk/querystring-parser             │    1000 │  431465.20 op/sec │  ± 0.83 % ║\n║ URLSearchParams-with-Object.fromEntries │    5000 │  833939.19 op/sec │  ± 0.97 % ║\n║ URLSearchParams-with-construct          │   10000 │  980017.92 op/sec │  ± 2.42 % ║\n║ node:querystring                        │   10000 │ 1068165.86 op/sec │  ± 3.41 % ║\n║ querystringparser                       │    3000 │ 1384001.31 op/sec │  ± 0.95 % ║\n╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ Fastest test                            │ Samples │            Result │ Tolerance ║\n╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ fast-querystring                        │   10000 │ 1584458.62 op/sec │  ± 2.64 % ║\n╚═════════════════════════════════════════╧═════════╧═══════════════════╧═══════════╝\n```\n\n- Stringify a query-string\n\n```\n\u003e node benchmark/stringify.mjs\n\n╔══════════════════════════════╤═════════╤═══════════════════╤═══════════╗\n║ Slower tests                 │ Samples │            Result │ Tolerance ║\n╟──────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ query-string                 │   10000 │  314662.25 op/sec │  ± 1.08 % ║\n║ qs                           │    9500 │  353621.74 op/sec │  ± 0.98 % ║\n║ http-querystring-stringify   │   10000 │  372189.04 op/sec │  ± 1.48 % ║\n║ @aws-sdk/querystring-builder │   10000 │  411658.63 op/sec │  ± 1.67 % ║\n║ URLSearchParams              │   10000 │  454438.85 op/sec │  ± 1.32 % ║\n║ querystringparser            │   10000 │  455615.18 op/sec │  ± 4.22 % ║\n║ querystringify               │   10000 │  879020.96 op/sec │  ± 2.12 % ║\n║ querystringify-ts            │   10000 │  879134.48 op/sec │  ± 2.19 % ║\n║ node:querystring             │   10000 │ 1244505.97 op/sec │  ± 2.12 % ║\n╟──────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ Fastest test                 │ Samples │            Result │ Tolerance ║\n╟──────────────────────────────┼─────────┼───────────────────┼───────────╢\n║ fast-querystring             │   10000 │ 1953717.60 op/sec │  ± 3.16 % ║\n╚══════════════════════════════╧═════════╧═══════════════════╧═══════════╝\n```\n\n- Importing package.\n\n```\n\u003e node benchmark/import.mjs\n\n╔═════════════════════════════╤═════════╤═════════════════╤═══════════╗\n║ Slower tests                │ Samples │          Result │ Tolerance ║\n╟─────────────────────────────┼─────────┼─────────────────┼───────────╢\n║ @aws-sdk/querystring-parser │    1000 │ 12360.51 op/sec │  ± 0.57 % ║\n║ qs                          │    1000 │ 14507.74 op/sec │  ± 0.36 % ║\n║ querystringify              │    1000 │ 14750.53 op/sec │  ± 0.39 % ║\n║ query-string                │    1000 │ 16335.05 op/sec │  ± 0.87 % ║\n║ querystringparser           │    1000 │ 17018.50 op/sec │  ± 0.42 % ║\n╟─────────────────────────────┼─────────┼─────────────────┼───────────╢\n║ Fastest test                │ Samples │          Result │ Tolerance ║\n╟─────────────────────────────┼─────────┼─────────────────┼───────────╢\n║ fast-querystring            │    2500 │ 74605.83 op/sec │  ± 0.91 % ║\n╚═════════════════════════════╧═════════╧═════════════════╧═══════════╝\n```\n","funding_links":["https://github.com/sponsors/anonrig"],"categories":["JavaScript","Utilities"],"sub_categories":["HTTP / URLs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonrig%2Ffast-querystring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonrig%2Ffast-querystring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonrig%2Ffast-querystring/lists"}