electron/docs/api/environment-variables.md
2016-05-17 16:02:54 -07:00

1.3 KiB

Environment Variables

Control application configuration and behavior without changing code.

Some behaviors of Electron are controlled by environment variables, because they are initialized earlier than command line and the app's code.

Examples on POSIX shells:

$ export ELECTRON_ENABLE_LOGGING=true
$ electron

on Windows console:

> set ELECTRON_ENABLE_LOGGING=true
> electron

ELECTRON_RUN_AS_NODE

Starts the process as a normal Node.js process.

ELECTRON_ENABLE_LOGGING

Prints Chrome's internal logging to console.

ELECTRON_LOG_ASAR_READS

When Electron reads from an ASAR file, log the read offset and file path to the system tmpdir. The resulting file can be provided to the ASAR module to optimize file ordering.

ELECTRON_ENABLE_STACK_DUMPING

When Electron crashed, prints the stack trace to console.

This environment variable will not work if crashReporter is started.

ELECTRON_DEFAULT_ERROR_MODE Windows

Shows Windows's crash dialog when Electron crashed.

This environment variable will not work if crashReporter is started.

ELECTRON_NO_ATTACH_CONSOLE Windows

Don't attach to current console session.

ELECTRON_FORCE_WINDOW_MENU_BAR Linux

Don't use global menu bar on Linux.