Node-red 1.3 function Modules problem

How do modules imported from function nodes be invoked in functions? thank you

It depends on the library that you have required but for the above example :

[{"id":"0bd4a2216f8d1ed7","type":"inject","z":"4895ea10b4ee9ead","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":370,"y":1000,"wires":[["a6b4049859c21f21"]]},{"id":"a6b4049859c21f21","type":"function","z":"4895ea10b4ee9ead","name":"","func":"msg.payload = cowsay2.say('hi')\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"cowsay2","module":"cowsay2"}],"x":550,"y":1000,"wires":[["2cfb705c6e0cbcb2"]]},{"id":"2cfb705c6e0cbcb2","type":"debug","z":"4895ea10b4ee9ead","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":1000,"wires":[]}]
2 Likes

Thank you very much UnborN
The imported module is ready for use

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.