in-window
function that tells you if the global window object exists.
install
npm i in-window --save
usage
var inWindow = require('in-window')
inWindow && window.document.querySelector('.thing')
test whether in browser
function that tells you if the global window object exists.
npm i in-window --save
var inWindow = require('in-window')
inWindow && window.document.querySelector('.thing')