environ
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

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
}

/environ/

    Package Sidebar

    Install

    npm i environ

    Weekly Downloads

    22

    Version

    3.0.3

    License

    MIT

    Unpacked Size

    10.1 kB

    Total Files

    13

    Last publish

    Collaborators

    • kjs3