Haresh Vidja Haresh Vidja - 4 months ago 85
Node.js Question

How to Fix ? DeprecationWarning: 'GLOBAL' is deprecated, use 'global'

How to fix Depricated warning message

(node:6136) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'


In my code I haev used something like below

// initializing globals
GLOBAL.user_session= {};
GLOBAL.config= require('./config/config.js');


So how to fix warning message?

Answer
global.user_session= {};
global.config= require('./config/config.js');