Skip to main content

Global Variables

These JavaScript variables can be used anywhere because these variables are defined in the window scope.

Predefined global variables#

NL_OSOperating system name: Linux, Windows, or Darwin
NL_APPIDApplication identifier
NL_PORTApplication port
NL_MODEMode of the application: window, browser, or cloud
NL_VERSIONNeutralinojs server version
NL_CVERSIONNeutralinojs client version
NL_CWDCurrent working directory
NL_PATHApplication path
NL_ARGSCommand-line arguments
NL_PIDIdentifier of the current process

Custom global variables#

You make custom global variables too via neutralino.config.json, as shown below.

"globalVariables": {
"TEST": "Test Value"

The above custom global variable's value can be accessed with NL_TEST.