Cross-platform hardware identifier collector that gathers system information (BIOS, board, CPU, GPU, storage, memory) for Linux environments, with special handling for Raspberry Pi and DMI-based systems.
linux_identifiers()— Main function that reads hardware data from/sys/class/dmi/id,/proc/cpuinfo, and various system utilities. Detects Raspberry Pi vs. standard DMI platforms.trimIdentifiers(val)— Strips null, empty, or'None'values from identifier objects.trimResults(val)— Removes private (_-prefixed) keys and falsy values from result arrays.brief(headers, obj)— Filters result objects to only include specified header keys.dataHandler(c)— Stdout data accumulator callback used with child process streams.
// Retrieve hardware identifiers on a Linux system
var computerIdentifiers = require('computer-identifiers');
var info = computerIdentifiers.linux_identifiers();
console.log(info.identifiers);
// {
// bios_vendor: 'American Megatrends Inc.',
// board_name: 'Z590 AORUS ULTRA',
// cpu_name: 'Intel(R) Core(TM) i9-11900K',
// gpu_name: ['NVIDIA Corporation GA102 [RTX 3090]'],
// ...
// }
console.log(info.linux.memory);
// Memory slots parsed from dmidecode output
console.log(info.linux.volumes);
// Filesystem volumes from df -T output- Requires system binaries:
lspci,lshw,df,dmidecode(optional), andvcgencmd(Raspberry Pi only). - Falls back to
lscpuif/proc/cpuinforeturns no CPU model. - Memory details are enriched via
dmidecodewhen available (DMI types 5, 6, 16, 17). - Part of the MeshAgent core module system, registered via
addModule('computer-identifiers', ...).