Calling a command line Node.js file

#1

I found some example Node.js applications that I would like to use within node red. I was successful at using the Exec node and called it via the a command like this "node "c:\testjs\test.js"" I keep thinking that there is a better way to execute the node javascript more directly. Is there some obvious way I am missing?

0 Likes

#2

Depends what you mean by inside Node-RED. If you want to keep them as files then exec is fine. Or you could paste the contents of the file into a function node and then have to fix it up to accept msg. as the input parameters etc, which is probably more work.

0 Likes