Checks if the current runtime environment is Node.js.
This function is useful to conditionally execute server-side logic.
It detects the Node.js environment by verifying the presence of the
global process object and its versions.node property.
Returns boolean
true if running in Node.js, otherwise false.
Example
if (isNode()) { console.log('Running in Node.js environment'); }
Checks if the current runtime environment is Node.js.
This function is useful to conditionally execute server-side logic. It detects the Node.js environment by verifying the presence of the global
process
object and itsversions.node
property.