
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A composable TypeScript filter system for querying and evaluating in-memory data. Provides a structured way to build complex query conditions that can be evaluated against entities.
Try it live: Go to https://modularizer.github.io/tsfiltor
npm install tsfiltor
This package is built with dual module support (ESM + CommonJS) for maximum compatibility:
The package automatically serves the correct format:
import { ... } from 'tsfiltor' → ESM (browsers, modern Node.js, bundlers)const { ... } = require('tsfiltor') → CommonJS (React Native, older tools)The package works in browsers via CDN. Use esm.sh or similar CDN:
<script type="module">
import { eq, gt, filterEntities } from 'https://esm.sh/tsfiltor@latest';
// Use the library...
</script>
Try it live: Go to https://modularizer.github.io/tsfiltor for an interactive playground with editable examples!
import { eq, gt, and, or, filterEntities, evaluateCondition } from 'tsfiltor';
const users = [
{ name: 'John', age: 25, status: 'active' },
{ name: 'Jane', age: 30, status: 'active' },
{ name: 'Bob', age: 18, status: 'inactive' },
];
// Build and evaluate conditions
const condition = and(
eq('status', 'active'),
gt('age', 20)
);
const activeAdults = filterEntities(users, condition);
// Returns: [{ name: 'John', age: 25, status: 'active' }, ...]
For a more fluent API, you can enable Array prototype extensions. The types are only available when you explicitly import the extensions module:
// Import types and functions - this activates TypeScript support for Array extensions
import 'tsfiltor/extensions';
import { enableArrayExtensions } from 'tsfiltor/extensions';
import { eq, gt, contains } from 'tsfiltor';
// Enable extensions (opt-in)
enableArrayExtensions();
const users = [
{ id: 1, name: 'John Doe', age: 30, email: 'john@example.com', status: 'active', tags: ['vip', 'premium'] },
{ id: 2, name: 'Jane Smith', age: 25, email: 'jane@example.com', status: 'active', tags: ['premium'] },
{ id: 3, name: 'Bob Johnson', age: 18, email: 'bob@test.com', status: 'inactive', tags: [] },
{ id: 4, name: 'Alice Brown', age: 35, email: 'alice@example.com', status: 'pending', tags: ['vip'] },
];
// Now arrays have .where(), .first(), .exists(), .count(), and .findWhere()
const activeUsers = users.where(eq('status', 'active'));
const john = users.first(eq('name', 'John'));
const hasVip = users.exists(contains('tags', 'vip'));
const count = users.count(gt('age', 25));
// Chain with native array methods
const names = users
.where(gt('age', 20))
.map(u => u.name)
.sort();
Note:
filterEntities(), findFirst(), etc. without enabling extensions.'tsfiltor/extensions' to get TypeScript type support - the types are NOT included in the main package export.'tsfiltor/extensions' activates the declare global block, making the Array extension methods available to TypeScript.eq(field, value) - Equalityne(field, value) - Not equallt(field, value) - Less thanlte(field, value) - Less than or equalgt(field, value) - Greater thangte(field, value) - Greater than or equalcontains(field, value) - String/array containsstartsWith(field, value) - String starts withendsWith(field, value) - String ends withmatches(field, pattern) - Regex pattern matchanyOf(field, values[]) - Value is in arrayminLength(field, n) - Minimum lengthmaxLength(field, n) - Maximum lengthisRecord(field) - Is plain object/RecordmatchesZodSchema(field, schema) - Matches Zod schemaand(...conditions) - All conditions must matchor(...conditions) - Any condition must matchnot(condition) - Negate conditionSee the examples directory for more detailed examples:
Register custom operators for specialized logic:
import { registerOperator, ConditionOperator } from 'tsfiltor';
registerOperator('priceRange', (fieldValue, conditionValue) => {
const [min, max] = conditionValue;
return fieldValue >= min && fieldValue <= max;
});
// Use the custom operator
const condition = {
field: 'price',
operator: 'priceRange' as ConditionOperator,
value: [100, 500],
};
evaluateCondition(entity, condition) - Evaluate condition against entityfilterEntities(entities, filter?) - Filter array of entitiesfindFirst(entities, filter?) - Find first matching entitymatchExists(entities, filter?) - Check if any entity matchescountWhere(entities, filter?) - Count matching entitiesfindWhere(entities, options?) - Find with pagination supportenableArrayExtensions(options?) - Enable Array prototype extensionsdisableArrayExtensions() - Disable Array prototype extensionsregisterOperator(operator, evaluator) - Register custom operatorUnlicense - This is free and unencumbered software released into the public domain.
For more information, see LICENSE or https://unlicense.org
FAQs
Composable TypeScript filters for querying and evaluating in-memory data.
We found that tsfiltor demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.