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