node-red-contrib-jexl

1.0.3 • Public • Published

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.

Package Sidebar

Install

npm i node-red-contrib-jexl

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

5.68 kB

Total Files

6

Last publish

Collaborators

  • ollix