
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
A simple and composable way to filter data.
Cullender is published on NPM registry. It's easy to integrate into your's
current project environment, you have just to install like the example below and
import/require cullender functions to filter something.
npm install cullender
This is a pretty module to convince you to use cullender to filter your stuff.
import { cull, filters } from 'cullender'
// ...
const latest = cull(
[ ...users ],
filters.truthy(),
(user) => getTime(user.created) > getTime() - 7 * DAY
)
cull: (Iterable<T>, ...filters) => Array<T> - Filter data with filter functionsimport { cull } from 'cullender'
const isAdmin = (user) => user.role === 'admin'
cull(
[ ...users ],
(user) => user.isActive,
isAdmin
)
create: ('AND'|'OR', ...filters) => boolean - Creates a filter functionimport { create } from 'cullender'
const isAdmin = create(
'AND',
(user) => user.isActive,
(user) => user.role === 'admin'
)
[ ...users ].filter(isAdmin)
// You could also use *cull* function.
cull(users, isAdmin)
filters: Object.<string, F => filter> - Some useful filter functionsfilters.truthy: <T>((T, number, Array<T>) => *) => filter - Filter truthyCheck if value, or function returned value is truthy.
import { cull, filters } from 'cullender'
cull(
users,
filters.truthy(user => user.id)
)
filters.into: <L, T>(Iterable.<L>, (T, number, Array<T>) => *): filter - Filter intoCheck if value, or function returned value is included on List.
import { cull, filters } from 'cullender'
const isAuthorized = filters.into(['admin', 'manager', 'executive'], user => user.role)
const authorized = cull(users, isAuthorized)
filters.search: <T>(string, (T, number, Array<T>) => string): filter - Search termsCheck if value, or function returned value matches search terms.
import { cull, filters } from 'cullender'
const terms = document.querySelector('input[type="search"]').value
const results = cull(
users,
(terms, user => [user.name, user.email]) // search into multiple values with
// an array you can use an plan
// string value either
)
filters.not: (filter) => filter - Not filterCheck if value, or function returned value matches search terms.
import { cull, filters } from 'cullender'
const withoutEmailUsers = cull(
users,
filters.not(filters.truthy(user => user.email))
)
Licensed under MIT License. You can see it here.
FAQs
A simple and composable way to filter data.
The npm package cullender receives a total of 23 weekly downloads. As such, cullender popularity was classified as not popular.
We found that cullender demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.