is-in-browser
Simple check to see if current app is running in browser
Last updated 8 years ago by tuxsudo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm 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 (4 years ago)

8 Versions

  • 2.0.0                                ...           4 years ago
  • 1.1.3                                ...           8 years ago
  • 1.1.2                                ...           8 years ago
  • 1.1.1                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.2                                ...           8 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 1
Last Month 8
Dependencies (0)
None
Dev Dependencies (11)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |