I am trying to use world-clock npm module within function node for the first time.
So, I installed module first, added one to the settings.js:
functionGlobalContext: {
worldClock:require('world-clock'),
},
And here's my function:
const wClock=global.get('worldClock');
msg.payload=wClock.today('SYSTEM').toString();
return msg;
Which returns "TypeError: wClock.today is not a function"
typeof(wClock.today) returns the same, but typeof(wClock) returns "function".
What did I do wrong?