actress-env
Check features of the current environment. You can have a window
in your Node, Webpack, React Native, or Cordova environment, but
it doesn't necessarily mean it's a browser. This is where this
package comes in. Distinguish target and features of
your current environment!
Installation
npm i -S actress-env
Usage
Include the library:
// CommonJS const actressEnv = // or AMD // or accessible via script tag on `window.__actressEnv__` // <script src="actress-env.js"></script>
Examples
If you're in a webpack or browserify like environment, you may receive an object similar to this:
console "target": "browser" "isBrowser": true "isBundler": true "isReactNative": false "isNode": false "hasRequire": true "hasWindow": true "hasProcess": true "hasGlobal": true