3.0.3 • Published 4 years ago

environ v3.0.3

Weekly downloads
35
License
MIT
Repository
github
Last release
4 years ago

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)
import { isBrowser } from 'environ'

// commonjs usage
const { isBrowser } = require('environ')

if (isBrowser()) {
  // do something
}