@gorules/zen-engine 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -55,6 +55,7 @@ const engine = new ZenEngine();
|
|
|
55
55
|
|
|
56
56
|
const decision = engine.createDecision(content);
|
|
57
57
|
const result = await decision.evaluate({ input: 15 });
|
|
58
|
+
console.log(result);
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
### Loaders
|
|
@@ -66,10 +67,11 @@ import { ZenEngine } from '@gorules/zen-engine';
|
|
|
66
67
|
import fs from 'fs/promises';
|
|
67
68
|
import path from 'path';
|
|
68
69
|
|
|
69
|
-
const loader = async (key: string) => fs.readFile(path.join(
|
|
70
|
+
const loader = async (key: string) => fs.readFile(path.join(import.meta.dirname, 'jdm_directory', key));
|
|
70
71
|
|
|
71
72
|
const engine = new ZenEngine({ loader });
|
|
72
73
|
const result = await engine.evaluate('jdm_graph1.json', { input: 5 });
|
|
74
|
+
console.log(result);
|
|
73
75
|
```
|
|
74
76
|
|
|
75
77
|
The same pattern works for loading from a REST API, S3, a database, or anywhere else. Full guides, including multi-decision graphs and batch evaluation, are in the [Node.js SDK documentation](https://docs.gorules.io/developers/sdks/nodejs).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gorules/zen-engine",
|
|
3
3
|
"description": "Open-source Business Rules Engine for Node.js, powered by Rust",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"browser": "browser.js",
|
|
7
7
|
"types": "./index.d.ts",
|
|
@@ -102,15 +102,15 @@
|
|
|
102
102
|
"resolutions": {
|
|
103
103
|
"form-data@^4.0.0": "4.0.4"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "a1f8c3e47011dee78edaad39e70f5e51220a4679",
|
|
106
106
|
"optionalDependencies": {
|
|
107
|
-
"@gorules/zen-engine-darwin-x64": "2.0.
|
|
108
|
-
"@gorules/zen-engine-linux-x64-gnu": "2.0.
|
|
109
|
-
"@gorules/zen-engine-linux-x64-musl": "2.0.
|
|
110
|
-
"@gorules/zen-engine-win32-x64-msvc": "2.0.
|
|
111
|
-
"@gorules/zen-engine-linux-arm64-gnu": "2.0.
|
|
112
|
-
"@gorules/zen-engine-linux-arm64-musl": "2.0.
|
|
113
|
-
"@gorules/zen-engine-darwin-arm64": "2.0.
|
|
114
|
-
"@gorules/zen-engine-wasm32-wasi": "2.0.
|
|
107
|
+
"@gorules/zen-engine-darwin-x64": "2.0.2",
|
|
108
|
+
"@gorules/zen-engine-linux-x64-gnu": "2.0.2",
|
|
109
|
+
"@gorules/zen-engine-linux-x64-musl": "2.0.2",
|
|
110
|
+
"@gorules/zen-engine-win32-x64-msvc": "2.0.2",
|
|
111
|
+
"@gorules/zen-engine-linux-arm64-gnu": "2.0.2",
|
|
112
|
+
"@gorules/zen-engine-linux-arm64-musl": "2.0.2",
|
|
113
|
+
"@gorules/zen-engine-darwin-arm64": "2.0.2",
|
|
114
|
+
"@gorules/zen-engine-wasm32-wasi": "2.0.2"
|
|
115
115
|
}
|
|
116
116
|
}
|