has-dom Check if a JavaScript environment has a DOM Install $ npm install has-dom Usage import hasDom from 'has-dom'; // In Node.js hasDom(); //=> false // In the browser hasDom(); //=> true