1.0.3 • Published 4 years ago

node-red-contrib-jexl v1.0.3

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

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.