🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matrix-eventfilter

Pass/Fail Object based filter. For Matrix OS

1.0.0
latest
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created

Instance Methods for Streaming API on Device & Server

Initialize With

var EventFilter = require('matrix-eventfilter').EventFilter;
var face = new EventFilter('face');
var vehicle = new EventFilter('vehicle');

Example Usage

Requires Then to Activate

// starts stream and queues callback
face.then(function(results, filter){})

Basic Filters

is / like

// single declaration
face.is('age', 23)

// object declaration
face.is({ 'age' : 24, gender:'male' })

// ranges
face.is({'age': {'$lte': 24, '$gte': 18}})

not

Negation

face.not('device')

contains

String match

vehicle.contains('make', 'Mustang')

near

Point and range.

vehicle.near([25,80], 1)

Complex Filters

Has

Has enables a subset of filters

Between
face.has('age').between(18,25);
Within
face.has('device').within([12,13,14,16]);
After (Aliases: Over, Above)
vehicle.has('year').after(1960);
Before (Aliases: Under, Below)
vehicle.has('year').under(2000)
Of
vehicle.has('color').of('red')

Real-World Examples

Vehicles traveling at high speeds.

vehicle.has('year').before(1960).has('speed').above(70).then(function(response) {
  console.log('Car is unsafe to drive at these speeds.');
});

Keywords

FAQs

Package last updated on 21 Sep 2016

Did you know?

Socket

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.

Install

Related posts