is-node
Determines if your code is running in Node.js.
isNode()
var isNode = require("can-globals/is-node/is-node");
var GLOBAL = require("can-globals/global/global");
if(isNode()) {
console.log(GLOBAL() === global); // -> true
}
Returns
{Boolean}
:
True if running in Node.js