UNPKG

is-electron-renderer

Version:

Check if code is running in Electron renderer process.

15 lines (10 loc) 304 B
function isRenderer () { // running in a web browser if (typeof process === 'undefined') return true // node-integration is disabled if (!process) return true // We're in node.js somehow if (!process.type) return false return process.type === 'renderer' } module.exports = isRenderer()