is-web

Check if it's Node.js or browser environment.


Keywords
check, if, node.js, browser, web, environment
License
MIT
Install
npm install is-web@1.0.2

Documentation

is-web · license npm travis

Check if it's Node.js or browser environment.

Installation

Yarn

yarn add is-web

npm

npm install is-web

Usage

import isWeb from 'is-web';

if (isWeb) {
  console.log('Hello from the Browser!');
} else {
  console.log('Hello from the Node.js!');
}