{"id":18817861,"url":"https://github.com/vitorluizc/cullender","last_synced_at":"2025-04-13T23:25:05.359Z","repository":{"id":57157303,"uuid":"107131071","full_name":"VitorLuizC/cullender","owner":"VitorLuizC","description":"Search data and create complex filters by compose filter functions.","archived":false,"fork":false,"pushed_at":"2018-09-06T20:48:35.000Z","size":195,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T06:35:44.645Z","etag":null,"topics":["compose","cull","cullender","filter","filter-data","filter-lists","filter-plugin","filterable","filtering","filterlist","filters","fp","functional-programming","javascript","search","searching"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/VitorLuizC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-16T13:27:07.000Z","updated_at":"2023-07-28T21:06:45.000Z","dependencies_parsed_at":"2022-08-28T06:02:47.712Z","dependency_job_id":null,"html_url":"https://github.com/VitorLuizC/cullender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitorLuizC%2Fcullender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitorLuizC%2Fcullender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitorLuizC%2Fcullender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VitorLuizC%2Fcullender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VitorLuizC","download_url":"https://codeload.github.com/VitorLuizC/cullender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248795331,"owners_count":21162750,"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":["compose","cull","cullender","filter","filter-data","filter-lists","filter-plugin","filterable","filtering","filterlist","filters","fp","functional-programming","javascript","search","searching"],"created_at":"2024-11-08T00:13:43.296Z","updated_at":"2025-04-13T23:25:05.336Z","avatar_url":"https://github.com/VitorLuizC.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cullender\n\n[![Build Status][ci-badge]][ci]\n\nA simple and composable way to filter data.\n\n## Installation\n\nCullender is published on NPM registry. It's easy to integrate into your's\ncurrent project environment, you have just to install like the example below and\n`import`/`require` cullender functions to filter something.\n\n```bash\nnpm install cullender\n```\n\nThis is a pretty module to convince you to use cullender to filter your stuff.\n\n```javascript\nimport { cull, filters } from 'cullender'\n\n// ...\n\nconst latest = cull(\n  [ ...users ],\n  filters.truthy(),\n  (user) =\u003e getTime(user.created) \u003e getTime() - 7 * DAY\n)\n```\n\n## API\n\n### `cull: (Iterable\u003cT\u003e, ...filters) =\u003e Array\u003cT\u003e` - Filter data with filter functions\n\n#### Example\n\n```js\nimport { cull } from 'cullender'\n\nconst isAdmin = (user) =\u003e user.role === 'admin'\n\ncull(\n  [ ...users ],\n  (user) =\u003e user.isActive,\n  isAdmin\n)\n```\n\n### `create: ('AND'|'OR', ...filters) =\u003e boolean` - Creates a filter function\n\n#### Example\n\n```js\nimport { create } from 'cullender'\n\nconst isAdmin = create(\n  'AND',\n  (user) =\u003e user.isActive,\n  (user) =\u003e user.role === 'admin'\n)\n\n[ ...users ].filter(isAdmin)\n\n// You could also use *cull* function.\ncull(users, isAdmin)\n```\n\n### `filters: Object.\u003cstring, F =\u003e filter\u003e` - Some useful filter functions\n\n### `filters.truthy: \u003cT\u003e((T, number, Array\u003cT\u003e) =\u003e *) =\u003e filter` - Filter truthy\n\nCheck if value, or function returned value is truthy.\n\n#### Example\n\n```js\nimport { cull, filters } from 'cullender'\n\ncull(\n  users,\n  filters.truthy(user =\u003e user.id)\n)\n```\n\n### `filters.into: \u003cL, T\u003e(Iterable.\u003cL\u003e, (T, number, Array\u003cT\u003e) =\u003e *): filter` - Filter into\n\nCheck if value, or function returned value is included on List.\n\n#### Example\n\n```js\nimport { cull, filters } from 'cullender'\n\nconst isAuthorized = filters.into(['admin', 'manager', 'executive'], user =\u003e user.role)\n\nconst authorized = cull(users, isAuthorized)\n```\n\n### `filters.search: \u003cT\u003e(string, (T, number, Array\u003cT\u003e) =\u003e string): filter` - Search terms\n\nCheck if value, or function returned value matches search terms.\n\n#### Example\n\n```js\nimport { cull, filters } from 'cullender'\n\nconst terms = document.querySelector('input[type=\"search\"]').value\n\nconst results = cull(\n  users,\n  (terms, user =\u003e [user.name, user.email]) // search into multiple values with\n                                           // an array you can use an plan\n                                           // string value either\n)\n```\n\n### `filters.not: (filter) =\u003e filter` - Not filter\n\nCheck if value, or function returned value matches search terms.\n\n#### Example\n\n```js\nimport { cull, filters } from 'cullender'\n\nconst withoutEmailUsers = cull(\n  users,\n  filters.not(filters.truthy(user =\u003e user.email))\n)\n```\n\n## License\n\nLicensed under MIT License. You can see it [here][license].\n\n\u003c!-- Links --\u003e\n[license]: ./LICENSE\n[ci]: https://travis-ci.org/VitorLuizC/cullender\n[ci-badge]: https://travis-ci.org/VitorLuizC/cullender.svg?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitorluizc%2Fcullender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitorluizc%2Fcullender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitorluizc%2Fcullender/lists"}