has-dom Check if a JavaScript environment has a DOM Install $ npm install has-dom Usage const hasDom = require('has-dom'); // In Node.js hasDom(); //=> false // In the browser hasDom(); //=> true License MIT © Sindre Sorhus