exenv-es6
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

exenv-es6

React's ExecutionEnvironment module extracted as ES6 functions. Based on the ExecutionEnviroment module licensed under the MIT license by Facebook, Inc

Package exports

canUseDOM - Checks if the DOM is available to access and use canUseWorkers - Checks if Web Workers are available for use canUseEventListeners - Checks if Event Listeners are available for use canUseViewport - Checks if there is a viewport available

Usage

npm i exenv-es6 --save
import { canUseDOM } from "exenv-es6";

if (canUseDOM()) {
    // do something that requires the dom
}

Inspired by exenv from JedWatson

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    83,439
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    83,439
  • 1.1.0
    0
  • 1.0.0
    274

Package Sidebar

Install

npm i exenv-es6

Weekly Downloads

83,713

Version

1.1.1

License

MIT

Unpacked Size

7.17 kB

Total Files

15

Last publish

Collaborators

  • chrisdholt