May 25, 2021 Electron
The process object
process
differs from the following in upstream node:
process.type
String - Process type, which can
browser
(i.e. main process) or
renderer
.
process.versions['electron']
String - Electron version.
process.versions['chrome']
String - Chromium version.
process.resourcesPath
- JavaScript source code path.
process.mas
Boolean - Created in the Mac App Store, its value
true
and elsewhere the value
undefined
.
Triggered when Electron has loaded its internal preset script and it is ready to load the main process or render process.
When node is completely shut down, it can be used by preloaded scripts to add (se: removed) a global symbol independent of node that recedes back to the global scope:
// preload.js
var _setImmediate = setImmediate;
var _clearImmediate = clearImmediate;
process.once('loaded', function() {
global.setImmediate = _setImmediate;
global.clearImmediate = _clearImmediate;
});
process.noAsar
Setting it true
true
asar
effective in node's built-in module.
process
object has the following methods:
process.hang()
Suspend the main thread of the current process.
process.setFdLimit(maxDescriptors)
OS X Linux
maxDescriptors
Integer
maxDescriptors
hard limits with os, whether or not it is lower than the current process.