mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 13:34:06 +03:00
437 B
437 B
title, tags, layout
| title | tags | layout | |||
|---|---|---|---|---|---|
| How to check if the code is running in nodejs in JavaScript |
|
note |
In this Article we will go through how to check if the code is running in nodejs only using single line of code in JavaScript.
Let's define this short function:
const isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;