For my instance i used it as a global and then called its for a time check of when hours of operation.
Below is from my index.js
global.globalDay = new Date().getDay();
global.globalHours = new Date().getHours();
To call the global's value from another file
/*
Days of the Week.
Sunday = 0, Monday = 1, Tuesday = 2, Wensday = 3, Thursday = 4, Friday = 5, Saturday = 6
Hours of the Day.
0 = Midnight, 1 = 1am, 12 = Noon, 18 = 6pm, 23 = 11pm
*/
if (global.globalDay === 6 || global.globalDay === 0) {
console.log('Its the weekend.');
} else if (global.globalDay > 0 && global.globalDay < 6 && global.globalHours > 8 && global.globalHours < 18) {
console.log('During Business Hours!');
} else {
console.log("Outside of Business hours!");
}