JSPM

is-browser

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 388372
  • Score
    100M100P100Q160067F
  • License MIT

Test whether you're a component in browser or a package in npm

Package Exports

  • is-browser

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-browser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-browser

Test whether you're running on the server or in the browser (using browserify)

Installation

$ npm install is-browser

API

This simply exports true or false:

if (require('is-browser')) {
  console.log('The module was installed using component');
} else {
  console.log('The module was installed using npm');
}

License

MIT