npm.io
1.0.0 • Published 6 years ago

in-browser-env

Licence
MIT
Version
1.0.0
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
1

inBrowserEnv

Uses this repo as a base.

inBrowserEnv is a way to check if a process is running in node or in the browser. This is useful when using frameworks like Nextjs or GatsbyJS.

Usage

Install

npm i in-browser-env --save
yarn add in-browser-env
In Code
import inBrowserEnv from "in-browser-env"

if (isBrowserEnv()) {
  // in a browser environment
}