Environ
Pretty secure detection of Node, browser, Electron, Deno, and other execution environments.
- Zero dependencies.
- Tree-shaking friendly so you're only left with what you use.
Install
yarn add environ
Or
npm install --save environ
Usage
// esm usage (Typescript, Babel, Node 12+ with flags) // commonjs usageconst isBrowser = if // do something