is-in-browser
Simple check to see if current app is running in browser
Last updated 6 years ago by tuxsudo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-in-browser 
SYNC missed versions from official npm registry.

Is In Browser?

import isBrowser from "is-in-browser";

if (isBrowser) {
  //...
}

More thoroughly:

import { isJsDom, isNode, isBrowser } from "is-in-browser";

if (isBrowser) {
  // you're in the browser
  // jsdom considered in browser
}

if (isJsDom) {
  // you're in the JSDom
}

if (isNode) {
  // you're in the Node
}

CommonJS

For those not using Babel / ES6 Modules

var isBrowser = require('is-in-browser').default;

if(isBrowser) { //... }

Current Tags

  • 2.0.0                                ...           latest (6 years ago)

8 Versions

  • 2.0.0                                ...           6 years ago
  • 1.1.3                                ...           10 years ago
  • 1.1.2                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 58
Today 1
This Week 6
This Month 29
Last Day 1
Last Week 6
Last Month 13
Dependencies (0)
None
Dev Dependencies (15)
Dependents (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE