easy-compare

JSON →
library 0.0.11 ·javascript
verified Jun 5, 2026

A lightweight JavaScript library (v0.0.11, stable, infrequent updates) for comparing values using MongoDB-style operators. It provides a simple `compare(value, operator)` function supporting comparison operators ($eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $size, $nsize, $regex, $nregex) and logical operators ($and, $or, $all, $not). Key differentiator: JSON-defined operator objects, making it suitable for rule engines or configurable validation. Minimal dependencies, tiny install size.