Feelin is a robust JavaScript library designed to parse and interpret FEEL (Friendly Enough Expression Language) expressions, a standard defined by DMN (Decision Model and Notation). It provides functions like `evaluate` and `unaryTest` for executing FEEL expressions against a given context. The current stable version is 6.2.0, with minor releases and dependency updates occurring regularly, indicating active maintenance. Key differentiators include its comprehensive recognition of the full FEEL grammar, context-sensitive evaluation (handling names with spaces), built-in FEEL functions, and a focus on error recovery with detailed warnings for issues such as `null` conversions. While not yet fully DMN TCK compliant, it aims for high fidelity to the standard, making it suitable for integrating DMN decision logic into JavaScript applications.
npm install feelinVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of `evaluate` and `unaryTest` functions, including context passing, list iteration, and inspecting `warnings` for execution issues like undefined variables.
Always check the `warnings` array in the returned object for detailed error information, especially when `value` is `null`. Adapt any logic that relied on implicit `null` handling to explicitly process these warnings.
Ensure your Node.js environment meets the minimum requirement of 20.12.0. Update Node.js if necessary.
For Node.js environments, use `import { evaluate } from 'feelin';` in ES module contexts. If you must use CommonJS, consider dynamic `import()` or ensuring your build setup transpiles ESM to CJS.Consult the project's DMN TCK coverage documentation (e.g., `./docs/DMN_TCK.md` in the repository) to understand current limitations and ensure critical DMN expressions function as expected in your specific use case. File issues for observed discrepancies.
Use ES module import syntax: `import { evaluate } from 'feelin';` in your JavaScript/TypeScript files. Ensure your project is configured for ES modules (e.g., `"type": "module"` in `package.json`).Ensure all variables referenced within your FEEL expression are provided as properties of the context object passed to `evaluate` or `unaryTest`. For example, `evaluate('x', { x: 10 })`.