Hi…i also had the same question and i think you should follow as suggested above that you can drag a function node into NodeRED and write code in it. You can write the function code in your favorite editor then cut and paste into the function node.