{"id":42489680,"url":"https://github.com/stein197/js-qs","last_synced_at":"2026-01-28T11:48:15.591Z","repository":{"id":56212737,"uuid":"225353357","full_name":"stein197/js-qs","owner":"stein197","description":"Simple bundle of JavaScript functions to make work with query string easer","archived":false,"fork":false,"pushed_at":"2023-07-18T08:34:34.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T15:05:43.870Z","etag":null,"topics":["parser","query-string","querystring"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/stein197.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-02T11:01:27.000Z","updated_at":"2023-04-23T06:42:40.000Z","dependencies_parsed_at":"2023-01-17T22:25:13.200Z","dependency_job_id":null,"html_url":"https://github.com/stein197/js-qs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/stein197/js-qs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Fjs-qs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Fjs-qs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Fjs-qs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Fjs-qs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stein197","download_url":"https://codeload.github.com/stein197/js-qs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stein197%2Fjs-qs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["parser","query-string","querystring"],"created_at":"2026-01-28T11:48:14.809Z","updated_at":"2026-01-28T11:48:15.583Z","avatar_url":"https://github.com/stein197.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript query string params parser and reader\n[![](https://img.shields.io/npm/v/@stein197/qs)](https://www.npmjs.com/package/@stein197/qs)\n[![](https://img.shields.io/github/license/stein197/js-qs)](LICENSE)\n\nURL Query string parser and stringifier. The package allows to customize parsing and stringifying process.\n\n## Installation\n```\nnpm install @stein197/qs\n```\n\n## Usage\nHere is the example of simple usage:\n```ts\nimport * as qs from \"@stein197/qs\";\n\nqs.stringify({a: 1, b: 2}); // \"a=1\u0026b=2\"\nqs.parse(\"a=1\u0026b=2\");        // {a: 1, b: 2}\n```\n\n## Key features\n- [Nesting structures support](#nesting-structures-support)\n- [Omitting redundant indices](#omitting-redundant-indices)\n- [Inferring arrays where possible](#inferring-arrays-where-possible)\n- [Inferring primitive types where possible](#inferring-primitive-types-where-possible)\n- [Inferring flags](#inferring-flags)\n- [Encoding and decoding](#encoding-and-decoding)\n- [Sparse arrays support](#sparse-arrays-support)\n- [Custom encoders and decoders](#custom-encoders-and-decoders)\n\n### Nesting structures support\nYou can pass to both functions complex structures, which includes objects and arrays:\n```ts\nqs.parse(\"a[b]=2\");        // {a: {b: 2}}\nqs.stringify({a: {b: 2}}); // \"a[b]=2\"\n```\nThe complexity of structures is unlimited - you can parse/stringify structures of any depth and type (object or array)\n\n### Omitting redundant indices\nThe indices of arrays of stringified result could be omitted where possible. You can disable this option by providing `indices` option with `true` value. You cannot do this properly with [qs](https://github.com/ljharb/qs), especially when it deals with deeply nested arrays.\n```ts\nqs.stringify({a: [1, 2, 3]}); // \"a[]=1\u0026a[]=2\u0026a[]=3\"\n```\nIndices could be ommited for more deep structures.\n\n### Inferring arrays where possible\nThe arrays could be inferred from query string where possible:\n```ts\nqs.parse(\"a[]=1\");  // {a: [1]}\nqs.parse(\"a[0]=1\"); // {a: [1]}\n```\nArrays could be inferred from more deep structures.\n\n### Inferring primitive types where possible\nBy default, `parse()` function will try to cast string values to corresponding types where possible (undefined, null, boolean or number).\n```ts\nqs.parse(\"a=undefined\u0026b=null\u0026c=false\u0026d=-1\"); // {a: undefined, b: null, c: false, d: -1}\n```\n\n### Inferring flags\nWhen an item doesn't have both value and separator, then `true` is returned for this specific key:\n```ts\nqs.parse(\"a=1\u0026b\"); // {a: 1, b: true}\nqs.stringify({a: 1, b: true}); \"a=1\u0026b\"\n```\n\n### Encoding and decoding\nWhen parsing and stringifying, special characters will be percent-encoded/decoded:\n```ts\nqs.parse(\"a=%20\"); // {a: \" \"}\nqs.stringify({a: \"\u0026\"}); // \"a=%26\"\n```\n\n### Sparse arrays support\nSince the package supports arrays, it supports sparse ones:\n```ts\nqs.parse(\"a[1]=1\");       // {a: [, 1]}\nqs.stringify({a: [, 1]}); // \"a[1]=1\"\n```\n\n### Custom encoders and decoders\nIf it's not enough, then you can provide an encoder and a decoder down to both functions like as follows:\n```ts\nqs.parse(\"a.b=1\u0026a.c=2\", {\n\tdecode: (rawKey: string, rawValue: string, index: number) =\u003e {\n\t\treturn [\n\t\t\trawKey.toUpperCase().split(\".\"),\n\t\t\trawValue * index\n\t\t]\n\t}\n}); // {A: {B: 0, C: 2}}\nqs.stringify({a: {b: 1, c: 2}}, {\n\tencode: (keyPath: string[], value: any, index: number) =\u003e {\n\t\treturn [\n\t\t\tkeyPath.join(\".\").toUpperCase(),\n\t\t\tString(value * index)\n\t\t]\n\t}\n}); // \"A.B=0\u0026A.C=2\"\n```\nTo get more information on how this works, please refer to the documentation in the source code.\n\n## API\n\u003e For more information, please refer to the documentation in source code.\n\n## NPM scripts\n- `browserify`. Create `qs.min.js` file to include directly via `\u003cscript /\u003e` tags\n- `build`. Run `clean`, `test`, `ts` and `browserify` scripts\n- `clean`. Remove compiled files\n- `test`. Run unit tests\n- `ts`. Compile the project\n- `ts:check`. Validate source code for compilation\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstein197%2Fjs-qs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstein197%2Fjs-qs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstein197%2Fjs-qs/lists"}