node-red-contrib-jexl 1.0.3

a node to use the JEXL expression language

npm install node-red-contrib-jexl

node-red-contrib-jexl

node-red node to parse and evaluate an expression against a context using jexl

What does it do?

The jexl node expects a msg.payload that contains a valid jexl expression, e.g.

(data.someprop + 2) > 42 ? "cannot be" : "this is right"

It also expects some data in the msg.context property. The expression is parsed and evaluated against this data, e.g.

{
    "data": {
        "someprop": 40      
    }
}

This would result in this string: this is right in msg.payload.

Ideas to improve this node

  • set the input property name for payload / context
  • allow to add operators or transforms by passing in more message parts, that contain javascript code
  • allow to set xml / yaml transforms to run these formats with the node.

If you have a feature request, please contact me or open a pull request.

Node Info

Version: 1.0.3
Updated 5 years, 8 months ago
License: MIT
Rating: not yet rated

Categories

Actions

Rate:

Downloads

5 in the last week

Nodes

  • jexl

Keywords

  • node-red
  • jexl
  • expression
  • el
  • language
  • parsing
  • parser

Maintainers