A way to export the functions of your Node Red Flows to a .js file

Hello Folks,

I am working on a bigger academic project atm and was looking for a way to export the code in my function Nodes to a .js file.

Main Reasons:

  1. Easier Versioning
  2. external editing in e.g. VSC

I am using basically some Core Nodes for this project and ,most of all, function nodes.
With around 5000 lines of function-node-code copy and paste is no option, evidently.

So I come up with this:

I needed this immediatly, so it is a quick-n-dirty-solution but it works fine so far.

You can simply pass in your complete flows.json.

Function Nodes then are extracted and written to a JS as js functions with results looking like this:

I expect to improve this and clear thing up in the future, add some more features, but for now this is what i needed instantly.

If you have ever been looking for something like this. You are welcome :slight_smile:

If not, thats okay for me :upside_down_face:

Have a nice Sunday, cheers from cold Germany

2 Likes