{"id":15297090,"url":"https://github.com/maxprilutskiy/filterion","last_synced_at":"2025-03-17T09:07:52.466Z","repository":{"id":37248826,"uuid":"182783923","full_name":"maxprilutskiy/filterion","owner":"maxprilutskiy","description":"🪄 A declarative JavaScript library for search params orchestration.","archived":false,"fork":false,"pushed_at":"2024-06-16T10:50:57.000Z","size":1539,"stargazers_count":38,"open_issues_count":7,"forks_count":100,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-04T22:33:56.360Z","etag":null,"topics":["filter","javascript","nodejs","query-string","querystring","search","searchparams","typescript","urlsearchparams"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/filterion","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/maxprilutskiy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2019-04-22T12:38:42.000Z","updated_at":"2025-02-23T19:51:45.000Z","dependencies_parsed_at":"2024-03-16T18:35:22.589Z","dependency_job_id":"2ded1470-af9c-4270-ac5f-1b2af35ace2e","html_url":"https://github.com/maxprilutskiy/filterion","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxprilutskiy%2Ffilterion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxprilutskiy%2Ffilterion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxprilutskiy%2Ffilterion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxprilutskiy%2Ffilterion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxprilutskiy","download_url":"https://codeload.github.com/maxprilutskiy/filterion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006258,"owners_count":20382441,"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":["filter","javascript","nodejs","query-string","querystring","search","searchparams","typescript","urlsearchparams"],"created_at":"2024-09-30T19:15:03.555Z","updated_at":"2025-03-17T09:07:52.438Z","avatar_url":"https://github.com/maxprilutskiy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"200\" src=\"/assets/logo.svg?sanitize=true\"\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eFilterion\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\nA zero-dependency, \u003ca href=\"https://en.wikipedia.org/wiki/Immutable_object\"\u003eimmutable\u003c/a\u003e data structure for search params management.\n\u003c/div\u003e\n\u003ch3 align=\"center\"\u003e\n\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)\n[![codecov](https://codecov.io/gh/maxprilutskiy/filterion/branch/main/graph/badge.svg?token=XNVEAODW13)](https://codecov.io/gh/maxprilutskiy/filterion)\n[![Release](https://github.com/maxprilutskiy/filterion/actions/workflows/release.yml/badge.svg)](https://github.com/maxprilutskiy/filterion/actions/workflows/release.yml)\n\n\u003c/h3\u003e\n\n## 📦 Install\n\nInstall `filterion` using npm:\n\n```\nnpm i filterion\n```\n\n## 🔨 Usage\n\nRequire it into any module and use natively:\n\n```javascript\nimport { Filterion } from 'filterion';\n\nconst filter = new Filterion()\n  .add('device', 'iPhone')\n  .add('price', 649);\n\nconsole.log(filter.getPayload());\n\n/*\n{\n  device: { '=': [ 'iPhone' ] },\n  price: { '=': [ 649 ] }\n}\n*/\n```\n\nOr leverage the query string API:\n```javascript\nimport { Filterion } from 'filterion';\n\nconst newQuery = new Filterion()\n  .fromQueryString('device=iPhone\u0026price=649')\n  .remove('price')\n  .add('year', 2007)\n  .toQueryString();\n\nconsole.log(newQuery);\n\n/*\ndevice=iPhone\u0026year=2007\n*/\n\n```\n\n#### Typescript\n\nFilterion can be used in a type-safe context:\n\n```typescript\nimport { Filterion } from 'filterion';\n\n// Good\nconst filterion = new Filterion\u003c{ price: string }\u003e()\n  .add('price', 649);\n\n// Bad\nconst filterion = new Filterion\u003c{ name: string }\u003e()\n  .add('price', 649);\n\n/*\nerror TS2345: Argument of type '\"price\"' is not assignable to parameter of type '\"name\"'.\n*/\n\n```\n\nInspired by [immutable.js](https://github.com/immutable-js/immutable-js), an immutable collections library for JavaScript.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxprilutskiy%2Ffilterion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxprilutskiy%2Ffilterion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxprilutskiy%2Ffilterion/lists"}