environ
v3.0.3
Published
Pretty secure detection of Node, browser, Electron, Deno, and other execution environments.
Downloads
183
Maintainers
Readme
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 environOr
npm install --save environUsage
// esm usage (Typescript, Babel, Node 12+ with flags)
import { isBrowser } from 'environ'
// commonjs usage
const { isBrowser } = require('environ')
if (isBrowser()) {
// do something
}