Support Questions
Find answers, ask questions, and share your expertise

Node.js / NPM modules in Apache Nifi ExecuteScript

What is the best way to use NPM modules in NiFi's ExecuteScript processor? I was thinking about trying to bundle the source and deps with some build tool like Browserify. Anyone tried this sort of thing?

1 REPLY 1

Super Guru

Interesting use case! I haven't tried it myself, but somehow you'd have to set up all the dependencies such that ExecuteScript (with Nashorn) could find the JS stuff, but that it could call out to the Node.js runtime.

An alternative approach might be Avatar.js, you could include their JAR dependencies in the Module Directory property, then conceivably use any of the supported modules. Although from their deployment model it almost looks like you'd need to run NiFi inside the Avatar server...

Yet another approach could be to run a web service from Node and hit it with InvokeHttp or a similar processor.