exenv

WebJar for exenv

Лицензия

Лицензия

BSD 3-Clause
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

exenv
Последняя версия

Последняя версия

1.2.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

exenv
WebJar for exenv
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/JedWatson/exenv

Скачать exenv

Имя Файла Размер
exenv-1.2.2.pom
exenv-1.2.2.jar 4 KB
exenv-1.2.2-sources.jar 22 bytes
exenv-1.2.2-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/exenv/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>exenv</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/exenv/
implementation 'org.webjars.npm:exenv:1.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/exenv/
implementation ("org.webjars.npm:exenv:1.2.2")
'org.webjars.npm:exenv:jar:1.2.2'
<dependency org="org.webjars.npm" name="exenv" rev="1.2.2">
  <artifact name="exenv" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='exenv', version='1.2.2')
)
libraryDependencies += "org.webjars.npm" % "exenv" % "1.2.2"
[org.webjars.npm/exenv "1.2.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

exenv

React's ExecutionEnvironment module extracted for use in other packages & components.

Usage

npm install exenv --save
var ExecutionEnvironment = require('exenv');

// You now have...
ExecutionEnvironment.canUseDOM             // is the DOM available? i.e window document etc. 
ExecutionEnvironment.canUseWorkers         // are Web Workers available?
ExecutionEnvironment.canUseEventListeners  // are Events available? i.e addEventListener etc.
ExecutionEnvironment.canUseViewport        // is there a viewport? i.e window.screen

Differences from React's ExecutionEnvironment

The ExecutionEnvironment lib in React 0.13 includes an isInWorker property, which is !canUseDOM. This is highly specific to React internals and probably (a) hacky and (b) not useful to other packages, so it has been left out. Please open an issue with your thoughts if you disagree or have a better idea.

Why?

A number of packages and components use React's private ExecutionEnvironment lib to detect available features, particularly to detect server-side rendering, e.g

canUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM; // BAD

It is bad practice to use React internals and this is likely to be broken / disabled in the future.

Use this package instead!

Версии библиотеки

Версия
1.2.2
1.2.0