Neutralino.computer
Neutralino.computer namespace contains methods related to the user's hardware.
computer.getMemoryInfo()
Returns system memory statistics in bytes.
Return Object (awaited):
physicalObject: Physical memory information.totalNumber: Total physical memory.availableNumber: Available physical memory.
virtualObject: Virtual memory information.totalNumber: Total virtual memory.availableNumber: Available virtual memory.
let memoryInfo = await Neutralino.computer.getMemoryInfo();
console.log(`RAM size: ${memoryInfo.physical.total}B`);
computer.getArch()
Returns the CPU architecture identifier: x64 (x86 64bit/arm64), ia32 (x86 32bit), arm, itanium,
or unknown.
Return String (awaited):
CPU architecture.
let arch = await Neutralino.computer.getArch();
console.log(arch);
computer.getKernelInfo()
Returns operating system kernel information.
Return Object (awaited):
variantString: Kernel type:Linux,Darwin,Windows NT, orUnknown.versionString: Version in the<major>.<minor>.<patch>-<build_number>format.
let kernelInfo = await Neutralino.computer.getKernelInfo();
console.log(`Kernel: ${kernelInfo.variant}`);
computer.getOSInfo()
Returns operating system information.
Return Object (awaited):
nameString: Operating system name.descriptionString: Operating system description.versionString: Version in the<major>.<minor>.<patch>-<build_number>format.
let osInfo = await Neutralino.computer.getOSInfo();
console.log(`OS: ${osInfo.name}`);
computer.getCPUInfo()
Returns the CPU information.
Return Object (awaited):
vendorString: Vendor name.modelString: Model name.frequencyNumber: The current CPU frequency in hertz (Hz).architectureString: CPU architecture name. Returns the same value as thegetArchfunction.logicalThreadsNumber: Number of logical threads in the parallelism model.physicalCoresNumber: Number of physical cores in the CPU.physicalUnitsNumber: Number of physical CPU hardware units in the motherboard.
let cpuInfo = await Neutralino.computer.getCPUInfo();
console.log(`CPU model: ${cpuInfo.model}`);
computer.getDisplays()
Returns information about all connected displays.
Return Object (awaited):
An array of Display objects.
Display
idNumber: A virtual display identifier.resolutionObject: Display resolution information.widthNumber: Display width.heightNumber: Display height.
dpiNumber: DPI (Dots Per Inch) value.bppNumber: BPP (Bits Per Pixel) value (also known as the color depth).refreshRateNumber: Refresh rate in hertz (Hz).
let displays = await Neutralino.computer.getDisplays();
for(let display of displays) {
console.log(display);
}
computer.getMousePosition()
Returns the current mouse cursor position.
Return Object (awaited):
xNumber: Distance from the left edge of the screen in pixels.yNumber: Distance from the top edge of the screen in pixels.
let pos = await Neutralino.computer.getMousePosition();
console.log(`Pos: ${pos.x}, ${pos.y}`);