{"id":22828752,"url":"https://github.com/sisimomo/spring-filter-query-builder","last_synced_at":"2025-08-21T12:37:13.143Z","repository":{"id":37427379,"uuid":"425078272","full_name":"sisimomo/Spring-Filter-Query-Builder","owner":"sisimomo","description":"A simple Typescript/JavaScript Query Builder for Spring Filter","archived":false,"fork":false,"pushed_at":"2024-09-03T05:47:08.000Z","size":170,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T16:24:13.962Z","etag":null,"topics":["filter","javascript","query-builder","spring","spring-filter","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/spring-filter-query-builder","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/sisimomo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-05T20:37:38.000Z","updated_at":"2025-04-05T07:34:02.000Z","dependencies_parsed_at":"2024-12-12T19:12:36.501Z","dependency_job_id":"62452ad6-1c11-46cc-aea7-43940c2974bf","html_url":"https://github.com/sisimomo/Spring-Filter-Query-Builder","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"d601b3e196870e02744baa0664538cd7ec9b00c9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisimomo%2FSpring-Filter-Query-Builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisimomo%2FSpring-Filter-Query-Builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisimomo%2FSpring-Filter-Query-Builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sisimomo%2FSpring-Filter-Query-Builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sisimomo","download_url":"https://codeload.github.com/sisimomo/Spring-Filter-Query-Builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250468686,"owners_count":21435528,"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","query-builder","spring","spring-filter","typescript"],"created_at":"2024-12-12T19:12:02.771Z","updated_at":"2025-04-23T16:24:24.824Z","avatar_url":"https://github.com/sisimomo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eSpring Filter Query Builder\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    A User-Friendly JavaScript/TypeScript Query Builder for \u003ca href=\"https://github.com/turkraft/spring-filter\"\u003eSpring Filter\u003c/a\u003e.\n    \u003cbr /\u003e\n    \u003ca href=\"#documentation\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://codesandbox.io/s/demo-yp3mgd\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/sisimomo/Spring-Filter-Query-Builder/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/sisimomo/Spring-Filter-Query-Builder/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#documentation\"\u003eDocumentation\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#classes\"\u003eClasses\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#operators\"\u003eOperators\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#comparators\"\u003eComparators\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#functions\"\u003eFunctions\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#customization\"\u003eCustomization\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\nElevate your development experience with our straightforward Query Builder designed for use alongside [Spring Filter](https://github.com/turkraft/spring-filter). This lightweight tool boasts simplicity by being dependency-free and compatible with TypeScript and JavaScript projects.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built With\n\n- [![Visual Studio Code][vscode-shield]](https://code.visualstudio.com/)\n- [![CodeSandbox][codesandbox-shield]](https://codesandbox.io/)\n- [![TypeScript][typescript-shield]](https://www.typescriptlang.org/)\n- [![NPM][npm-shield]](https://www.npmjs.com/)\n- [![Jest][jest-shield]](https://jestjs.io/)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n## Usage\n\n1. Install the package using [NPM](https://www.npmjs.com/package/spring-filter-query-builder):\n\n   ```bash\n   npm install spring-filter-query-builder\n   ```\n\n2. Import the required functions from `spring-filter-query-builder` into your JavaScript/TypeScript file:\n\n   ```js\n   import { sfAnd, sfEqual, sfGt, sfIsNull, sfLike, sfNot, sfOr } from 'spring-filter-query-builder';\n   ```\n\n3. Here's an example of how to use the library:\n\n   ```js\n   const filter = sfAnd([sfEqual('status', 'active'), sfGt('createdAt', '1-1-2000')]);\n\n   console.log(filter.toString());\n   ```\n\n   This will output the generated filter query.\n\n   Explore Further with Examples\n\n   For additional examples, feel free to visit our [CodeSandbox demo page](https://codesandbox.io/s/demo-yp3mgd).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- Documentation --\u003e\n\n## Documentation\n\nAll classes have a toString method. So you can convert any Object of these classes to string easily.\n\nThe library exposes all methods that you will need to create a query:\n\n### Operators\n\n- **`sfAnd([ item, item, ... ])`** - and's one or more expressions\n- **`sfOr([ item, item ... ])`** - or's one or more expressions\n- **`sfNot(item)`** - not's an expression\n- **`sfExists(item)`** - exists expression\n\n### Comparators\n\n- **`sfLike(selector, value)`** - Like comparator\n- **`sfEqual(selector, value)`** - Equal comparator\n- **`sfNotEqual(selector, value)`** - Not equal comparator\n- **`sfGt(selector, value)`** - Greater than comparator\n- **`sfGe(selector, value)`** - Greater than or equal comparator\n- **`sfLt(selector, value)`** - Less than comparator\n- **`sfLe(selector, value)`** - Less than or equal comparator\n- **`sfIsNull(selector)`** - Is null comparator\n- **`sfIsNotNull(selector)`** - Is not null comparator\n- **`sfIsEmpty(selector)`** - Is empty comparator\n- **`sfIsNotEmpty(selector)`** - Is not empty comparator\n- **`sfIn(selector, [ value, value, ...])`** - In comparator\n- **`sfNotIn(selector, [ value, value, ...])`** - Not in comparator\n\n### Functions\n\n- **`sfAbsolute(selector)`** - Absolute function\n- **`sfAverage(selector)`** - Average function\n- **`sfCeiling(selector)`** - Ceiling function\n- **`sfConcat(value, value, ...)`** - Concat function\n- **`sfCount(selector)`** - Count function\n- **`sfCountDistinct(selector)`** - CountDistinct function\n- **`sfCurrentDate()`** - CurrentDate function\n- **`sfCurrentTime()`** - CurrentTime function\n- **`sfCurrentTimestamp()`** - CurrentTimestamp function\n- **`sfMin(selector)`** - Min function\n- **`sfMax(selector)`** - Max function\n- **`sfSum(selector, selector, ...)`** - Sum function\n- **`sfSize(selector)`** - Size function\n- **`sfLength(selector)`** - Length function\n- **`sfTrim(selector)`** - Trim function\n- **`sfUpper(selector)`** - Upper function\n- **`sfLower(selector)`** - Lower function\n- **`sfCustomFunction(functionName, value, value, ...)`** - Any other custom function\n\n### Customization\n\nExtend any of our predefined abstract classes – [Comparator](src/comparators.ts), [Function](src/functions.ts), and [Operator](src/operator.ts) – to effortlessly craft custom logic tailored to your needs.\n\nFor creating custom comparators, refer to [test/custom-comparator.test.ts](test/custom-comparator.test.ts).\n\nFor custom functions, explore [test/custom-function.test.ts](test/custom-function.test.ts).\n\nFor custom operators, explore [test/custom-operator.test.ts](test/custom-operator.test.ts).\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTRIBUTING --\u003e\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTACT --\u003e\n\n## Contact\n\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[contributors-shield]: https://img.shields.io/github/contributors/sisimomo/Spring-Filter-Query-Builder.svg?style=for-the-badge\n[contributors-url]: https://github.com/sisimomo/Spring-Filter-Query-Builder/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/sisimomo/Spring-Filter-Query-Builder.svg?style=for-the-badge\n[forks-url]: https://github.com/sisimomo/Spring-Filter-Query-Builder/network/members\n[stars-shield]: https://img.shields.io/github/stars/sisimomo/Spring-Filter-Query-Builder.svg?style=for-the-badge\n[stars-url]: https://github.com/sisimomo/Spring-Filter-Query-Builder/stargazers\n[issues-shield]: https://img.shields.io/github/issues/sisimomo/Spring-Filter-Query-Builder.svg?style=for-the-badge\n[issues-url]: https://github.com/sisimomo/Spring-Filter-Query-Builder/issues\n[license-shield]: https://img.shields.io/github/license/sisimomo/Spring-Filter-Query-Builder.svg?style=for-the-badge\n[license-url]: https://github.com/sisimomo/Spring-Filter-Query-Builder/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://www.linkedin.com/in/simon-vallieres-358555187/\n[typescript-shield]: https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=white\n[npm-shield]: https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge\u0026logo=npm\u0026logoColor=white\n[jest-shield]: https://img.shields.io/badge/-jest-%23C21325?style=for-the-badge\u0026logo=jest\u0026logoColor=white\n[vscode-shield]: https://img.shields.io/badge/Visual%20Studio%20Code-0078d7.svg?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white\n[codesandbox-shield]: https://img.shields.io/badge/Codesandbox-000000?style=for-the-badge\u0026logo=CodeSandbox\u0026logoColor=white\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisimomo%2Fspring-filter-query-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsisimomo%2Fspring-filter-query-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsisimomo%2Fspring-filter-query-builder/lists"}