expression service

Provides safe, Esprima-based expression evaluation. This service is provided via the tymly plugin and isn't offered by any of the other core plugins.

Boot config

  • This service doesn’t require any configuration to boot.

Service methods/properties


Parses a string expression and returns an object for subsequent evaluation


  • expression string The expression that needs evaluating.


var exp = expressionService.parse('a > b')
console.log(exp.evaluate({a: 10, b: 5})) // true
console.log(exp.evaluate({a: 5, b: 10})) // false

Returns Object Use the evaluate function (uses the static-eval package)