{"id":26216373,"url":"https://github.com/bartektelec/easy-queryparams","last_synced_at":"2026-04-13T11:32:08.441Z","repository":{"id":57218636,"uuid":"454504309","full_name":"bartektelec/easy-queryparams","owner":"bartektelec","description":"🌀 Convert JS objects to query strings and vice versa","archived":false,"fork":false,"pushed_at":"2022-06-30T17:40:29.000Z","size":218,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T21:52:25.150Z","etag":null,"topics":["javascript","parsing","querystring","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/easy-queryparams","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/bartektelec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-01T18:30:06.000Z","updated_at":"2023-08-30T21:20:54.000Z","dependencies_parsed_at":"2022-08-28T21:40:58.939Z","dependency_job_id":null,"html_url":"https://github.com/bartektelec/easy-queryparams","commit_stats":null,"previous_names":["bartektelec/easy-querystring"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bartektelec/easy-queryparams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartektelec%2Feasy-queryparams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartektelec%2Feasy-queryparams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartektelec%2Feasy-queryparams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartektelec%2Feasy-queryparams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartektelec","download_url":"https://codeload.github.com/bartektelec/easy-queryparams/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartektelec%2Feasy-queryparams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31751303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["javascript","parsing","querystring","typescript","typescript-library"],"created_at":"2025-03-12T11:29:11.731Z","updated_at":"2026-04-13T11:32:08.422Z","avatar_url":"https://github.com/bartektelec.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# easy-queryparams [![release version](https://img.shields.io/npm/v/easy-queryparams)](https://www.npmjs.com/package/easy-queryparams)\n\n[![weekly download count](https://img.shields.io/npm/dm/easy-queryparams)](https://npmcharts.com/compare/easy-queryparams?interval=30\u0026minimal=true) ![primary language procentage](https://img.shields.io/github/languages/top/bartektelec/easy-queryparams) ![workflow build status](https://img.shields.io/github/workflow/status/bartektelec/easy-queryparams/Release%20npm%20package) ![last commit badge](https://img.shields.io/github/last-commit/bartektelec/easy-queryparams)\n\n\u003c/div\u003e\n\nThis is a package that let's you easy convert an object to a querystring, or parse it the other way around. It's main difference from JS `URLSearchParams` is that it by default avoids params with nullish values.\n\nThe package exposes two methods: `stringify` and `parse`.\n\n## Getting started\n\n-   Install this package\n\n```bash\n$ npm i easy-queryparams\n```\n\n-   Import the methods in your project\n\n```ts\nimport * as qs from 'easy-querystring';\n```\n\n## Examples\n\n### Stringify method\n\nThis method takes an object as a parameter and converts it to a string, omitting all nullish valued properties.\n\n```ts\nimport { stringify } from 'easy-queryparams';\n\nconst filters = {\n    minAge: 20,\n    maxAge: 50,\n    selected: [1, 2, 3, 4],\n    location: null,\n};\n\nconst queryString = stringify(filters); // \"minAge=20\u0026maxAge=50\u0026selected=1%2C2%2C3%2C4\"\n```\n\n#### Splitting arrays to multiple params\n\nYou can add a option object if you want all array values to be split for multiple parameters i.e.\n\n```ts\nconst queryString = stringify(filters, { splitArrays: true }); // \"children=Adam\u0026children=Eva\u0026children=Dave\"\n```\n\n### Parse method\n\nThis method takes a query string as a parameter and returns an object. All values that are separated with commas will be converted to an array, and all parsable numbers will return a number type.\n\n```ts\nimport { parse } from 'easy-queryparams';\n\nconst queryString =\n    'pickedNumbers=1%2C30%2Cabcd%2C50%2C200\u0026location=New%20York';\n\nconst filters = parse(queryString);\n// {\n//     pickedNumbers: [1, 30, 'abcd', 50, 200],\n//     location: 'New York'\n// }\n```\n\n## TypeScript Support\n\nYou can import the `.ts` files from `easy-queryparams/src`, however you will be forced to explicitly assert a type to your object when using the `parse` method, just like you would do with `JSON.parse`.\n\n## Licence\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartektelec%2Feasy-queryparams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartektelec%2Feasy-queryparams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartektelec%2Feasy-queryparams/lists"}