get-global is a simple tool for getting the global object. If it's running in the browser, it will return window, if it's running in node.js it will return GLOBAL, or whatever the global object is in the current runtime.
It will work in 'strict mode' too.
npm install get-global
How to use
var getGlobal = ;
var globalObject = ;globalObject === window; // in the browserglobalObject === GLOBAL; // in node.js