
Research
/Security News
CanisterWorm: npm Publisher Compromise Deploys Backdoor Across 29+ Packages
The worm-enabled campaign hit @emilgroup and @teale.io, then used an ICP canister to deliver follow-on payloads.
@filtron/core
Advanced tools
Fast, type-safe query language parser for filtering data in real-time APIs. Built with Ohm.js.
ohm-js runtime requiredbun add @filtron/core
# or
npm install @filtron/core
import { parse } from "@filtron/core";
const result = parse('age > 18 AND status = "active"');
if (result.success) {
console.log(result.ast);
// Use AST to build SQL, filter data, etc.
} else {
console.error(result.error);
}
..or use parseOrThrow for try/catch style error handling:
import { parseOrThrow } from "@filtron/core";
try {
const ast = parseOrThrow('age > 18 AND status = "active"');
console.log(ast);
// Use AST to build SQL, filter data, etc.
} catch (error) {
console.error(error.message);
}
// Comparison operators
parse("age > 18");
parse('status = "active"');
parse("score >= 4.5");
// Boolean operators
parse("age > 18 AND verified");
parse('role = "admin" OR role = "moderator"');
parse("NOT suspended");
// Field existence
parse("email?");
parse("name EXISTS");
// One-of expressions
parse('status : ["pending", "approved", "active"]');
// Complex queries
parse('(role = "admin" OR role = "mod") AND status = "active"');
// Nested fields
parse("user.profile.age >= 18");
| Operator | Meaning | Example |
|---|---|---|
=, : | Equal | status = "active" |
!=, !: | Not equal | role != "guest" |
>, >=, <, <= | Comparison | age >= 18 |
~ | Contains | name ~ "john" |
?, EXISTS | Field exists | email? |
AND, OR, NOT | Boolean logic | a AND b OR c |
parse('age > 18 AND status = "active"')
// Returns:
{
type: "and",
left: {
type: "comparison",
field: "age",
operator: ">",
value: { type: "number", value: 18 }
},
right: {
type: "comparison",
field: "status",
operator: "=",
value: { type: "string", value: "active" }
}
}
Full type definitions included:
import type {
ParseResult,
ASTNode,
ComparisonExpression,
// ... all types exported
} from "@filtron/core";
function handleAST(node: ASTNode) {
switch (node.type) {
case "comparison":
// TypeScript knows node.field, node.operator, node.value exist
break;
case "and":
// TypeScript knows node.left, node.right exist
break;
// ... fully typed
}
}
SQL WHERE clause generator with parameterized queries for safe database filtering.
import { parse } from "@filtron/core";
import { toSQL } from "@filtron/sql";
const result = parse('age > 18 AND status = "active"');
if (result.success) {
const { sql, params } = toSQL(result.ast);
// sql: "(age > $1 AND status = $2)"
// params: [18, "active"]
const users = await db.query(`SELECT * FROM users WHERE ${sql}`, params);
}
Features:
$1, MySQL/SQLite/DuckDB ?)See the @filtron/sql README for full documentation.
Parse Time: ~50μs per query
Throughput: 18,755 parses/sec
Startup: <1ms with pre-compiled grammar
Memory: Efficient GC, minimal allocation
Run benchmarks: bun run bench
The Filtron query language syntax was strongly inspired by dumbql.
MIT - See LICENSE
FAQs
Filtron parses human-friendly filter strings into structured queries you can use anywhere — SQL databases, in-memory arrays, or your own custom backend.
The npm package @filtron/core receives a total of 1 weekly downloads. As such, @filtron/core popularity was classified as not popular.
We found that @filtron/core 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.

Research
/Security News
The worm-enabled campaign hit @emilgroup and @teale.io, then used an ICP canister to deliver follow-on payloads.

Research
/Security News
Attackers compromised Trivy GitHub Actions by force-updating tags to deliver malware, exposing CI/CD secrets across affected pipelines.

Security News
ENISA’s new package manager advisory outlines the dependency security practices companies will need to demonstrate as the EU’s Cyber Resilience Act begins enforcing software supply chain requirements.