Created
July 22, 2016 13:59
-
-
Save abhirathore2006/c3dd989cdfc8e7ab2c029f6244dbf8e6 to your computer and use it in GitHub Desktop.
check if on Node Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// Establish the root object, `window` in the browser, or `global` on the server. | |
var root = this; | |
// Create a reference to this | |
var _ = new Object(); | |
var isNode = false; | |
// Export the Underscore object for **CommonJS**, with backwards-compatibility | |
// for the old `require()` API. If we're not in CommonJS, add `_` to the | |
// global object. | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = _; | |
root._ = _; | |
isNode = true; | |
} else { | |
root._ = _; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment