Skip to content

electron-utils/electron-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

electron-platform

Linux Build Status Windows Build status Dependency Status devDependency Status

Platform detection for Electron and Web Browser.

Install

npm install --save electron-platform

Usage

const platform = require('electron-platform');

if ( platform.isRendererProcess ) {
  // do something
}

API Reference

Properties

isNode

Indicates whether executes in node.js application.

isElectron

Indicates whether executes in electron.

isNative

Indicates whether executes in native environment (compare to web-browser).

isPureWeb

Indicates whether executes in common web browser.

isRendererProcess

Indicates whether executes in common web browser, or editor's renderer process(web-page).

isMainProcess

Indicates whether executes in editor's main process.

isDarwin

Indicates whether executes in OSX.

isWin32

Indicates whether executes in Windows.

isDev

Check if running in retina display. If we are in renderer process and nodeIntegration is false, isDev will be undefined.

isRetina

Check if running in retina display.

License

MIT © 2017 Johnny Wu

About

Platform detection for Electron, Web Browser and Node

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published