Check in which environment the code is running - browser/node.js/webworker/jsdom/deno
Pretty secure detection of Node, browser, Electron, Deno, and other execution environments.
Detect runtime environment. Supports Node.js, Deno, Bun and browsers.
Detects if the javascript is being loaded from a server (SSR) or a web client