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

1.0.0 • Public • Published

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
}

/in-browser-env/

    Package Sidebar

    Install

    npm i in-browser-env

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    7.38 kB

    Total Files

    10

    Last publish

    Collaborators

    • adro.codes