Como saber se a janela existe no NodeJS
if(typeof window !== 'undefined') {
console.log("this should print only if window object actually exists")
}
Gleaming Grasshopper
if(typeof window !== 'undefined') {
console.log("this should print only if window object actually exists")
}