Const
Checks if the current runtime environment is Node.js.
process
versions.node
true if running in Node.js, otherwise false.
true
false
if (isNode) { console.log('Running in Node.js environment');} Copy
if (isNode) { console.log('Running in Node.js environment');}
Node.js process documentation
Checks if the current runtime environment is Node.js.