As this question and NodeRed suggests, I need to include this in settings.js in order to use a module inside a function node:
functionGlobalContext: {
osModule:require('os')
},
Followed by
var osMod = global.get('osModule');
msg.payload = osMod.platform();
return msg;
In the function node as a simple example, which returns the "TypeError: Cannot read property 'platform' of undefined" error.
What am I doing wrong?