Registry / serialization / feelin

feelin

JSON →
library6.2.0jsnpmunverified

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 feelin
INSTALL
IMPORT
SIG · FEELIN
F
feelin
serializationjavascriptv6.2.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

evaluate
✓ import { evaluate } from 'feelin';
✗ const { evaluate } = require('feelin');
Feelin is an ESM-first package, requiring Node.js >= 20.12.0 for direct usage. Use named imports.
unaryTest
✓ import { unaryTest } from 'feelin';
✗ import unaryTest from 'feelin';
Both `unaryTest` and `evaluate` are named exports, not default. Ensure correct destructuring.
*
✓ import * as feelin from 'feelin';
This pattern imports all named exports into a namespace object, useful for accessing multiple utilities without individual destructuring.

Demonstrates basic usage of `evaluate` and `unaryTest` functions, including context passing, list iteration, and inspecting `warnings` for execution issues like undefined variables.

import { evaluate, unaryTest } from 'feelin'; // Evaluate a simple expression with a context const result1 = evaluate("Mike's daughter.name", { 'Mike\'s daughter.name': 'Lisa' }); console.log('Expression evaluation:', result1.value); // Lisa // Perform a unary test const result2 = unaryTest('1', { '?': 1 }); console.log('Unary test 1:', result2.value); // true const result3 = unaryTest('[1..end]', { '?': 1, end: 10 }); console.log('Unary test 2:', result3.value); // true // Iterate and transform a list const result4 = evaluate('for a in [1, 2, 3] return a * 2'); console.log('Loop evaluation:', result4.value); // [2, 4, 6] // Check warnings for undefined variables or null conversions const { value, warnings } = evaluate('x'); console.log('Undefined variable result:', value); // null console.log('Warnings for undefined variable:', warnings); /* Output: [ { message: "Variable 'x' not found", type: 'NO_VARIABLE_FOUND', position: { from: 0, to: 1 } } ] */
Debug
Known issues
breakingStarting with v6.0.0, the package explicitly reports `null` conversion errors in the `warnings` array. Previously, such errors might have been silently handled or returned `null` without explicit warning details. Developers should now inspect the `warnings` property of the result object to understand why a `null` value was produced.
fix
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.
affects: >=6.0.0
gotchaFeelin requires Node.js version 20.12.0 or higher. Using it with older Node.js versions may lead to compatibility issues, particularly with ESM imports or underlying dependencies.
fix
Ensure your Node.js environment meets the minimum requirement of 20.12.0. Update Node.js if necessary.
affects: <20.12.0
gotchaThe package is primarily designed as an ES module (ESM). Attempting to use `require()` for imports in a CommonJS environment without proper transpilation or configuration will result in an error.
fix
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.
affects: all
gotchaWhile `feelin` recognizes the full FEEL grammar and includes many built-in functions, it is not yet fully compliant with the DMN TCK (Decision Model and Notation Test Compatibility Kit). This means certain complex or edge-case FEEL expressions might behave differently compared to a fully TCK-compliant engine.
fix
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.
affects: all
Errors
Common errors & fixes
TypeError: require is not a function
Attempting to import `feelin` using CommonJS `require()` syntax in an ES module context or without proper CommonJS fallback/transpilation.
fix
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`).
Variable 'x' not found
An expression references a variable (e.g., 'x') that is not present in the provided context object.
fix
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 })`.
Upgrade
Version history
6.2.0latest on npm
Audit
Dependencies
lezer-feelrequiredCore dependency providing the FEEL language definition for parsing.
@lezer/commonrequiredUnderlying Lezer parser system component.
Agent activity
8 hits · last 30 days
node
8
Resources
feelin — npm install feelin · libregistry