{"id":42369484,"url":"https://github.com/devinrhode2/actually-good-query-param-parser-lib","last_synced_at":"2026-01-27T19:17:07.158Z","repository":{"id":62810062,"uuid":"561596091","full_name":"devinrhode2/actually-good-query-param-parser-lib","owner":"devinrhode2","description":"type safe query param parsing URLSearchParams typescript","archived":false,"fork":false,"pushed_at":"2023-07-10T13:27:12.000Z","size":343,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T00:59:11.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devinrhode2.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-11-04T03:11:58.000Z","updated_at":"2023-03-04T05:38:18.000Z","dependencies_parsed_at":"2022-11-07T03:30:35.384Z","dependency_job_id":null,"html_url":"https://github.com/devinrhode2/actually-good-query-param-parser-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devinrhode2/actually-good-query-param-parser-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinrhode2%2Factually-good-query-param-parser-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinrhode2%2Factually-good-query-param-parser-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinrhode2%2Factually-good-query-param-parser-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinrhode2%2Factually-good-query-param-parser-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devinrhode2","download_url":"https://codeload.github.com/devinrhode2/actually-good-query-param-parser-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devinrhode2%2Factually-good-query-param-parser-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28819162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T18:44:20.126Z","status":"ssl_error","status_checked_at":"2026-01-27T18:44:09.161Z","response_time":168,"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":[],"created_at":"2026-01-27T19:17:05.777Z","updated_at":"2026-01-27T19:17:07.152Z","avatar_url":"https://github.com/devinrhode2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# type safe query param parsing URLSearchParams typescript\n\nThis is a TINY wrapper around URLSearchParams.\n\nIt's a query string parsing library. That is type safe.\n\nIt parses `globalThis.location.search` by default.\n\nThe benefit of this library, is that it will throw errors\nif you have duplicate query params. This may be desirable\nin environments where you want to be strict about your query params.\n\nIf you aren't concerned with other devs/sys admins adding query params with incorrect casing,\nthen just do this:\n\n```ts\nwindow.location.search.includes('foo=1')\n```\n\nOr this:\n\n```ts\nconst params = new URLSearchParams(\n  window.location.search,\n)\nparams.get('foo') === '1'\n```\n\n# Usage\n\n```ts\nimport { getParam } from 'actually-good-query-param-parser-lib'\n\nconst param = getParam('paramName')\n// Returns `string | undefined`\n```\n\nYou can avoid throwing errors in prod by passing in an `isProd` boolean:\n\n```ts\n// env.ts:\nexport const isProd =\n  process.env.NODE_ENV ===\n    'production' \u0026\u0026\n  location.origin ===\n    'https://www.domain.com'\n\n// component.tsx:\nimport { isProd } from './env'\n\nconst param = getParam('paramName', {\n  isProd,\n})\n```\n\nIn edge cases, you can pass in your own queryString:\n\n```ts\nconst param = getParam('paramName', {\n  queryString: '?paramName=1',\n})\n```\n\n## Contributing\n\nTSDX scaffolds your new library inside `/src`.\n\nTo run TSDX, use:\n\n```bash\nnpm start # or yarn start\n```\n\nThis builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.\n\nTo do a one-off build, use `npm run build` or `yarn build`.\n\nTo run tests, use `npm test` or `yarn test`.\n\n## Configuration\n\nCode quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.\n\n### Jest\n\nJest tests are set up to run with `npm test` or `yarn test`.\n\n### Bundle Analysis\n\n[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.\n\n#### Setup Files\n\nThis is the folder structure we set up for you:\n\n```txt\n/src\n  index.tsx       # EDIT THIS\n/test\n  blah.test.tsx   # EDIT THIS\n.gitignore\npackage.json\nREADME.md         # EDIT THIS\ntsconfig.json\n```\n\n### Rollup\n\nTSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.\n\n### TypeScript\n\n`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.\n\n## Continuous Integration\n\n### GitHub Actions\n\nTwo actions are added by default:\n\n- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix\n- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)\n\n## Optimizations\n\nPlease see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:\n\n```js\n// ./types/index.d.ts\ndeclare var __DEV__: boolean\n\n// inside your code...\nif (__DEV__) {\n  console.log('foo')\n}\n```\n\nYou can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.\n\n## Module Formats\n\nCJS, ESModules, and UMD module formats are supported.\n\nThe appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.\n\n## Named Exports\n\nPer Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.\n\n## Including Styles\n\nThere are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.\n\nFor vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.\n\n## Publishing to NPM\n\nWe recommend using [np](https://github.com/sindresorhus/np).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinrhode2%2Factually-good-query-param-parser-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevinrhode2%2Factually-good-query-param-parser-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevinrhode2%2Factually-good-query-param-parser-lib/lists"}