[
  {
    "path": "LICENSE",
    "content": "BSD License\n\nFor React software\n\nCopyright (c) 2013-2015, Facebook, Inc.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n * Neither the name Facebook nor the names of its contributors may be used to\n   endorse or promote products derived from this software without specific\n   prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "# exenv\n\nReact's ExecutionEnvironment module extracted for use in other packages &amp; components.\n\n## Usage\n\n```\nnpm install exenv --save\n```\n\n```js\nvar ExecutionEnvironment = require('exenv');\n\n// You now have...\nExecutionEnvironment.canUseDOM             // is the DOM available? i.e window document etc. \nExecutionEnvironment.canUseWorkers         // are Web Workers available?\nExecutionEnvironment.canUseEventListeners  // are Events available? i.e addEventListener etc.\nExecutionEnvironment.canUseViewport        // is there a viewport? i.e window.screen\n```\n\n### Differences from React's ExecutionEnvironment\n\nThe `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.\n\n## Why?\n\nA number of packages and components use React's private ExecutionEnvironment lib to detect available features, particularly to detect server-side rendering, e.g\n\n```\ncanUseDOM = require('react/lib/ExecutionEnvironment').canUseDOM; // BAD\n```\n\n**It is bad practice to use React internals** and this is likely to be broken / disabled in the future.\n\nUse this package instead!\n"
  },
  {
    "path": "index.js",
    "content": "/*!\n  Copyright (c) 2015 Jed Watson.\n  Based on code that is Copyright 2013-2015, Facebook, Inc.\n  All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"exenv\",\n  \"version\": \"1.2.2\",\n  \"description\": \"React's ExecutionEnvironment module extracted for use in other packages & components\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"See React tests\\\" && exit 0\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/JedWatson/exenv.git\"\n  },\n  \"keywords\": [\n    \"react\",\n    \"browser\",\n    \"server\",\n    \"environment\",\n    \"env\",\n    \"execution\",\n    \"executionenvironment\"\n  ],\n  \"author\": \"Jed Watson\",\n  \"license\": \"BSD-3-Clause\",\n  \"bugs\": {\n    \"url\": \"https://github.com/JedWatson/exenv/issues\"\n  },\n  \"homepage\": \"https://github.com/JedWatson/exenv\"\n}\n"
  }
]