A minimal high-performance specification-backed stateful object matching engine
License: MIT License
CoffeeScript 31.83%JavaScript 68.17%
stream-sift's Introduction
stream-sift
Pattern matching for singleton or streaming documents [1].
Installation
npm install --save stream-sift
Overview
What
stream-sift is a document [1] pattern-matching library superficially similar to e.g. mongoDB query search syntax. It is suitable to use directly or build higher-level abstractions that compile down to it (eg: a RQL-like library).
[1] "Document" in the NoSQL sense; JavaScript "objects", Ruby "hashes", Elm "records", etc.
How
stream-sift is divided into a "core" and "library". The core is an engine suitable for building arbitrary $functions on top of. Currently this project is "batteries included" meaning that a $function library is included, but is entirely modular and apart from core. In the future the $function library will be made its own project.
Divide by value and check if remainder equals another value. The default remainder-check is against 0 and thus can be phrased as "does this static value evenly fit into the incoming value".