Skip to content

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

License

Notifications You must be signed in to change notification settings

ollixx/node-red-contrib-jexl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published