Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ npm install json-rules-engine
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).

```js
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')


/**
Expand Down Expand Up @@ -109,7 +109,7 @@ Fact information is loaded via API call during runtime, and the results are cach
It also demonstates use of the condition _path_ feature to reference properties of objects returned by facts.

```js
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')

// example client for making asynchronous requests to an api, database, etc
import apiClient from './account-api-client'
Expand Down
6 changes: 6 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/node_modules
npm-debug.log
.vscode
.idea
.DS_Store
*.tgz
3 changes: 1 addition & 2 deletions examples/01-hello-world.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const Rule = require('json-rules-engine').Rule
const { Engine, Rule } = require('json-rules-engine')

/**
* Setup a new engine
Expand Down
2 changes: 1 addition & 1 deletion examples/02-nested-boolean-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')
/**
* Setup a new engine
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/03-dynamic-facts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')
// example client for making asynchronous requests to an api, database, etc
const apiClient = require('./support/account-api-client')

Expand Down
2 changes: 1 addition & 1 deletion examples/04-fact-dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')
const accountClient = require('./support/account-api-client')

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/05-optimizing-runtime-with-fact-priorities.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')
const accountClient = require('./support/account-api-client')

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/06-custom-operators.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')


/**
Expand Down
2 changes: 1 addition & 1 deletion examples/07-rule-chaining.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')

/**
* Setup a new engine
Expand Down
2 changes: 1 addition & 1 deletion examples/08-fact-comparison.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')

/**
* Setup a new engine
Expand Down
2 changes: 1 addition & 1 deletion examples/09-rule-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* DEBUG=json-rules-engine node ./examples/09-rule-results.js
*/
require('colors')
const Engine = require('json-rules-engine').Engine
const { Engine } = require('json-rules-engine')

/**
* Setup a new engine
Expand Down
53 changes: 53 additions & 0 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "json-rules-engine-examples",
"version": "1.0.0",
"description": "examples for json-rule-engine",
"main": "",
"private": true,
"scripts": {
"all": "for i in *.js; do node $i; done;"
},
"author": "Cache Hamm <cache.hamm@gmail.com>",
"license": "ISC",
"dependencies": {
"json-rules-engine": "6.0.0-alpha-3"
}
}