browser-or-node
Check in which environment the code is running - browser/node.js/webworker/jsdom/deno
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.