var moment = require(\'moment-timezone\');
I am trying to establish a timezone correct date/time stamp
As this GitHub issue answer states, you cannot use require
itself inside a function node, but you can add external modules to the sandbox used to run functions. You would do this setting functionGlobalContext
inside your settings.js
file like the following:
functionGlobalContext: {
tzModule:require('moment-timezone')
}
The module can then be referenced by using the following code:
var moment = global.get('tzModule');
Check out the Node-RED documentation on global-context for full details.