showing results for - "detect nodejs"
Lena
18 Sep 2017
1(function () {
2
3    // Establish the root object, `window` in the browser, or `global` on the server.
4    var root = this; 
5
6    // Create a reference to this
7    var _ = new Object();
8
9    var isNode = false;
10
11    // Export the Underscore object for **CommonJS**, with backwards-compatibility
12    // for the old `require()` API. If we're not in CommonJS, add `_` to the
13    // global object.
14    if (typeof module !== 'undefined' && module.exports) {
15            module.exports = _;
16            root._ = _;
17            isNode = true;
18    } else {
19            root._ = _;
20    }
21})();
22
similar questions
queries leading to this page
detect nodejs