Skip to content

Commit 0b36ee6

Browse files
authored
Merge pull request #222 from juan2357/master
{ Engine }
2 parents 5759a92 + d7a30ed commit 0b36ee6

10 files changed

+14
-23
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
![json-rules-engine](http://i.imgur.com/MAzq7l2.png)
2-
32
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
43
[![Build Status](https://github.com/cachecontrol/json-rules-engine/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/cachecontrol/json-rules-engine/workflows/Node.js%20CI/badge.svg?branch=master)
54

@@ -33,7 +32,8 @@ $ npm install json-rules-engine
3332
This example demonstrates an engine for detecting whether a basketball player has fouled out (a player who commits five personal fouls over the course of a 40-minute game, or six in a 48-minute game, fouls out).
3433

3534
```js
36-
import { Engine } from 'json-rules-engine'
35+
const Engine = require('json-rules-engine').Engine
36+
3737

3838
/**
3939
* Setup a new engine
@@ -109,7 +109,7 @@ Fact information is loaded via API call during runtime, and the results are cach
109109
It also demonstates use of the condition _path_ feature to reference properties of objects returned by facts.
110110

111111
```js
112-
import { Engine } from 'json-rules-engine'
112+
const Engine = require('json-rules-engine').Engine
113113

114114
// example client for making asynchronous requests to an api, database, etc
115115
import apiClient from './account-api-client'

examples/01-hello-world.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is the hello-world example from the README.
54
*
@@ -11,8 +10,8 @@
1110
*/
1211

1312
require('colors')
14-
const Engine = require('../dist').Engine
15-
const Rule = require('../dist').Rule
13+
const Engine = require('json-rules-engine').Engine
14+
const Rule = require('json-rules-engine').Rule
1615

1716
/**
1817
* Setup a new engine

examples/02-nested-boolean-logic.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This example demonstates nested boolean logic - e.g. (x OR y) AND (a OR b).
54
*
@@ -11,8 +10,7 @@
1110
*/
1211

1312
require('colors')
14-
const Engine = require('../dist').Engine
15-
13+
const Engine = require('json-rules-engine').Engine
1614
/**
1715
* Setup a new engine
1816
*/

examples/03-dynamic-facts.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This example demonstrates computing fact values at runtime, and leveraging the 'path' feature
54
* to select object properties returned by facts
@@ -12,7 +11,7 @@
1211
*/
1312

1413
require('colors')
15-
const Engine = require('../dist').Engine
14+
const Engine = require('json-rules-engine').Engine
1615
// example client for making asynchronous requests to an api, database, etc
1716
const apiClient = require('./support/account-api-client')
1817

examples/04-fact-dependency.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is an advanced example that demonstrates facts with dependencies
54
* on other facts. In addition, it demonstrates facts that load data asynchronously
@@ -13,7 +12,7 @@
1312
*/
1413

1514
require('colors')
16-
const Engine = require('../dist').Engine
15+
const Engine = require('json-rules-engine').Engine
1716
const accountClient = require('./support/account-api-client')
1817

1918
/**

examples/05-optimizing-runtime-with-fact-priorities.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is an advanced example that demonstrates using fact priorities to optimize the rules engine.
54
*
@@ -11,7 +10,7 @@
1110
*/
1211

1312
require('colors')
14-
const Engine = require('../dist').Engine
13+
const Engine = require('json-rules-engine').Engine
1514
const accountClient = require('./support/account-api-client')
1615

1716
/**

examples/06-custom-operators.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This example demonstrates using custom operators.
54
*
@@ -17,7 +16,8 @@
1716
*/
1817

1918
require('colors')
20-
const Engine = require('../dist').Engine
19+
const Engine = require('json-rules-engine').Engine
20+
2121

2222
/**
2323
* Setup a new engine

examples/07-rule-chaining.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is an advanced example demonstrating rules that passed based off the
54
* results of other rules by adding runtime facts. It also demonstrates
@@ -13,7 +12,7 @@
1312
*/
1413

1514
require('colors')
16-
const Engine = require('../dist').Engine
15+
const Engine = require('json-rules-engine').Engine
1716

1817
/**
1918
* Setup a new engine

examples/08-fact-comparison.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is a basic example demonstrating a condition that compares two facts
54
*
@@ -11,7 +10,7 @@
1110
*/
1211

1312
require('colors')
14-
const Engine = require('../dist').Engine
13+
const Engine = require('json-rules-engine').Engine
1514

1615
/**
1716
* Setup a new engine

examples/09-rule-results.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
2-
32
/*
43
* This is a basic example demonstrating how to leverage the metadata supplied by rule results
54
*
@@ -10,7 +9,7 @@
109
* DEBUG=json-rules-engine node ./examples/09-rule-results.js
1110
*/
1211
require('colors')
13-
const Engine = require('../dist').Engine
12+
const Engine = require('json-rules-engine').Engine
1413

1514
/**
1615
* Setup a new engine

0 commit comments

Comments
 (0)