New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

facts-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facts-js

Rules engine

latest
npmnpm
Version
1.0.6
Version published
Weekly downloads
5
-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

FactsJS -- JS Rules Engine

NPM

Installation

In browsers:

<script src="facts.js"></script>

Using npm:

npm i --save facts-js

{sudo} npm i -g facts-js
npm ln facts-js

In Node.js & Ringo:

var FactsJS = require('facts-js');

In an AMD loader:

require(['facts'], function(FactsJS) {

});

Usage

var FactsJS = require('facts-js');

rules = new FactsJS.Rules({
    rules: [{
        name: 'x > 2',
        condition: FactsJS.Conditions.gt('x', 2),
        fire: FactsJS.RulesEngine.setFact('y', 10)
    }]
});

engine = new FactsJS.RulesEngine({
    rules: rules,
    facts: {
        x: 1, y: 1
    }
});

engine.fact('x', 3);
console.log(engine.fact('y')); // should print 10

Running Tests

gulp test

Dependencies

  • lodash

Keywords

facts

FAQs

Package last updated on 01 Apr 2014

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