update (c) year, blockDevices: added removable attribute

This commit is contained in:
Sebastian Hildebrandt 2017-01-19 09:45:27 +01:00
parent 5821afd5e9
commit d637bd9261
16 changed files with 135 additions and 119 deletions

View File

@ -94,6 +94,7 @@ Other changes
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 3.16.0 | 2017-01-19 | blockDevices: added removable attribute + fix |
| 3.15.1 | 2017-01-17 | minor cpuTemperature fix (OSX) | | 3.15.1 | 2017-01-17 | minor cpuTemperature fix (OSX) |
| 3.15.0 | 2017-01-15 | added cpuTemperature also for OSX | | 3.15.0 | 2017-01-15 | added cpuTemperature also for OSX |
| 3.14.0 | 2017-01-14 | added currentLoad per cpu/core, cpu cache and cpu flags | | 3.14.0 | 2017-01-14 | added currentLoad per cpu/core, cpu cache and cpu flags |

View File

@ -42,22 +42,23 @@ si.cpu()
### Latest Activity ### Latest Activity
- Version 3.15.0: added cpuTemperature also for OSX - Version 3.16.0: `blockDevices`: added removable attribute
- Version 3.14.0: added currentLoad per cpu/core, cpu cache (L1, L2, L3) and cpu flags - Version 3.15.0: added `cpuTemperature` also for OSX
- Version 3.13.0: added shell (returns standard shell) - Version 3.14.0: added `currentLoad` per cpu/core, cpu cache (L1, L2, L3) and cpu flags
- Version 3.12.0: refactoring and extended currentLoad (better OSX coverage and added irq load). - Version 3.13.0: added `shell` (returns standard shell)
- Version 3.11.0: blockDevices now also for OSX and also extended (+ label, model, serial, protocol). - Version 3.12.0: refactoring and extended `currentLoad` (better OSX coverage and added irq load).
- Version 3.10.0: added blockDevices (list of disks, partitions, raids and roms). - Version 3.11.0: `blockDevices` now also for OSX and also extended (+ label, model, serial, protocol).
- Version 3.9.0: extended networkInterfaces (added MAC address). - Version 3.10.0: added `blockDevices` (list of disks, partitions, raids and roms).
- Version 3.8.0: added dockerContainerProcesses (array of processes inside a docker container). - Version 3.9.0: extended `networkInterfaces` (added MAC address).
- Version 3.7.0: extended docker stats. - Version 3.8.0: added `dockerContainerProcesses` (array of processes inside a docker container).
- Version 3.6.0: added versions (kernel, ssl, node, npm, pm2, ...). - Version 3.7.0: extended `dockerContainerStats`.
- Version 3.5.0: added graphics info (controller and display). - Version 3.6.0: added `versions` (kernel, ssl, node, npm, pm2, ...).
- Version 3.4.0: rewritten currentLoad and CPU load for processes (linux). This is now much more accurate. - Version 3.5.0: added `graphics` info (controller and display).
- Version 3.3.0: added process list. Get full process list including details like cpu and mem usage, status, command, ... - Version 3.4.0: rewritten `currentLoad` and CPU load for processes (linux). This is now much more accurate.
- Version 3.2.0: added battery support. If a battery is installed, you get information about status and current capacity level - Version 3.3.0: added `processes.list`. Get full process list including details like cpu and mem usage, status, command, ...
- Version 3.2.0: added `battery` support. If a battery is installed, you get information about status and current capacity level
- Version 3.1.0: added [Docker][docker-url] support. Now you can scan your docker containers and get their stats - Version 3.1.0: added [Docker][docker-url] support. Now you can scan your docker containers and get their stats
- Version 3.0.0: added DisksIO - overall diskIO and IOPS values for all mounted volumes - Version 3.0.0: added `disksIO` - overall diskIO and IOPS values for all mounted volumes
### Changelog ### Changelog
@ -188,7 +189,8 @@ This library is splitted in several sections:
| - [0].uuid | X | X | UUID | | - [0].uuid | X | X | UUID |
| - [0].label | X | X | label | | - [0].label | X | X | label |
| - [0].model | X | X | model | | - [0].model | X | X | model |
| - [0].serial | X | | serial | | - [0].serial | X | | serial |
| - [0].removable | X | X | serial |
| - [0].protocol | X | X | protocol (SATA, PCI-Express, ...) | | - [0].protocol | X | X | protocol (SATA, PCI-Express, ...) |
| si.fsStats(cb) | X | X | current transfer stats | | si.fsStats(cb) | X | X | current transfer stats |
| - rx | X | X | bytes read since startup | | - rx | X | X | bytes read since startup |
@ -381,6 +383,7 @@ Written by Sebastian Hildebrandt [sebhildebrandt](https://github.com/sebhildebra
- Riccardo Novaglia [richy24](https://github.com/richy24) - Riccardo Novaglia [richy24](https://github.com/richy24)
- Quentin Busuttil [Buzut](https://github.com/Buzut) - Quentin Busuttil [Buzut](https://github.com/Buzut)
- lapsio [lapsio](https://github.com/lapsio) - lapsio [lapsio](https://github.com/lapsio)
- csy [csy](https://github.com/csy1983)
OSX Temperature: Credits here are going to: OSX Temperature: Credits here are going to:

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // battery.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // cpu.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // docker.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // filesystem.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT
@ -36,7 +36,9 @@ function fsSize(callback) {
process.nextTick(() => { process.nextTick(() => {
if (_windows) { if (_windows) {
let error = new Error(NOT_SUPPORTED); let error = new Error(NOT_SUPPORTED);
if (callback) { callback(NOT_SUPPORTED) } if (callback) {
callback(NOT_SUPPORTED)
}
reject(error); reject(error);
} }
@ -60,7 +62,9 @@ function fsSize(callback) {
} }
}); });
} }
if (callback) { callback(data) } if (callback) {
callback(data)
}
resolve(data); resolve(data);
}); });
}); });
@ -98,13 +102,16 @@ function parseDevices(lines) {
label: '', label: '',
model: '', model: '',
serial: '', serial: '',
removable: false,
protocol: '' protocol: ''
}; };
parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, ''); parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, '');
parts[1] = parts[1].trim(); parts[1] = parts[1].trim();
if ('DEVICEIDENTIFIER' == parts[0]) devices[i].identifier = parts[1]; if ('DEVICEIDENTIFIER' == parts[0]) devices[i].identifier = parts[1];
if ('DEVICENODE' == parts[0]) devices[i].name = parts[1]; if ('DEVICENODE' == parts[0]) devices[i].name = parts[1];
if ('VOLUMENAME' == parts[0]) { if (parts[1].indexOf('Not applicable') == -1) devices[i].label = parts[1]; } if ('VOLUMENAME' == parts[0]) {
if (parts[1].indexOf('Not applicable') == -1) devices[i].label = parts[1];
}
if ('PROTOCOL' == parts[0]) devices[i].protocol = parts[1]; if ('PROTOCOL' == parts[0]) devices[i].protocol = parts[1];
if ('DISKSIZE' == parts[0]) devices[i].size = parseBytes(parts[1]); if ('DISKSIZE' == parts[0]) devices[i].size = parseBytes(parts[1]);
if ('FILESYSTEMPERSONALITY' == parts[0]) devices[i].fstype = parts[1]; if ('FILESYSTEMPERSONALITY' == parts[0]) devices[i].fstype = parts[1];
@ -113,6 +120,7 @@ function parseDevices(lines) {
if ('READ-ONLYMEDIA' == parts[0] && parts[1] == 'Yes') devices[i].physical = 'CD/DVD'; if ('READ-ONLYMEDIA' == parts[0] && parts[1] == 'Yes') devices[i].physical = 'CD/DVD';
if ('SOLIDSTATE' == parts[0] && parts[1] == 'Yes') devices[i].physical = 'SSD'; if ('SOLIDSTATE' == parts[0] && parts[1] == 'Yes') devices[i].physical = 'SSD';
if ('VIRTUAL' == parts[0]) devices[i].type = 'virtual'; if ('VIRTUAL' == parts[0]) devices[i].type = 'virtual';
if ('REMOVABLEMEDIA' == parts[0]) devices[i].removable = (parts[1] == 'Removable');
if ('PARTITIONTYPE' == parts[0]) devices[i].type = 'part'; if ('PARTITIONTYPE' == parts[0]) devices[i].type = 'part';
if ('DEVICE/MEDIANAME' == parts[0]) devices[i].model = parts[1]; if ('DEVICE/MEDIANAME' == parts[0]) devices[i].model = parts[1];
} }
@ -122,80 +130,79 @@ function parseDevices(lines) {
return devices; return devices;
} }
function fromTo(header, label) {
let from = header.indexOf(label);
let to = from + label.length;
for (let i = to; i < header.length && header[i] == ' '; i++) {
to = i
}
return {
from: from,
to: to
}
}
function parseBlk(lines) { function parseBlk(lines) {
let header = lines[0];
let ft_label = fromTo(header, 'LABEL');
let ft_model = fromTo(header, 'MODEL');
let ft_serial = fromTo(header, 'SERIAL');
lines.splice(0, 1);
let data = []; let data = [];
lines.forEach(orgline => {
if (orgline != '') { lines.filter(line => line != '').forEach((line) => {
if (orgline.substr(header.indexOf('FSTYPE'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('FSTYPE')) + '-' + orgline.substr(header.indexOf('FSTYPE') + 1, 1000)} let disk = JSON.parse(line);
if (orgline.substr(header.indexOf('MOUNTPOINT'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('MOUNTPOINT')) + '-' + orgline.substr(header.indexOf('MOUNTPOINT') + 1, 1000)} data.push({
if (orgline.substr(header.indexOf('UUID'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('UUID')) + '-' + orgline.substr(header.indexOf('UUID') + 1, 1000)} 'name': disk.name,
if (orgline.substr(header.indexOf('TRAN'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('TRAN')) + '-' + orgline.substr(header.indexOf('TRAN') + 1, 1000)} 'type': disk.type,
let line = orgline.replace(/[├─│└]+/g, ""); 'fstype': disk.fstype,
line = line.replace(/ +/g, " ").trim().split(' '); 'mount': disk.mountpoint,
data.push({ 'size': parseInt(disk.size),
'name': line[0], 'physical': (disk.type == 'disk' ? (disk.rota == '0' ? 'SSD' : 'HDD') : (disk.type == 'rom' ? 'CD/DVD' : '')),
'type': line[1], 'uuid': disk.uuid,
'fstype': (line[3] == '-' ? '' : line[3]), 'label': disk.label,
'mount': (line[4] == '-' ? '' : line[4]), 'model': disk.model,
'size': parseInt(line[2]), 'serial': disk.serial,
'physical': (line[1] == 'disk' ? (line[6] == '0' ? 'SSD' : 'HDD') : (line[1] == 'rom' ? 'CD/DVD' : '')), 'removable': disk.rm == '1',
'uuid': (line[5] == '-' ? '' : line[5]), 'protocol': disk.tran
'label': orgline.substring(ft_label.from, ft_label.to).trim(), })
'model': orgline.substring(ft_model.from, ft_model.to).trim(),
'serial': (ft_serial.from >= 0 ? orgline.substring(ft_serial.from, ft_serial.to).trim() : ''),
'protocol': (ft_serial.from >= 0 && line[8] == '-' ? '' : line[8])
})
}
}); });
data = util.unique(data); data = util.unique(data);
data = util.sortByKey(data, ['type', 'name']); data = util.sortByKey(data, ['type', 'name']);
return data; return data;
} }
function blkStdoutToObject(stdout) {
return stdout.toString()
.replace(/NAME=/g, '{"name":')
.replace(/FSTYPE=/g, ',"fstype":')
.replace(/TYPE=/g, ',"type":')
.replace(/SIZE=/g, ',"size":')
.replace(/MOUNTPOINT=/g, ',"mountpoint":')
.replace(/UUID=/g, ',"uuid":')
.replace(/ROTA=/g, ',"rota":')
.replace(/RO=/g, ',"ro":')
.replace(/RM=/g, ',"rm":')
.replace(/TRAN=/g, ',"tran":')
.replace(/SERIAL=/g, ',"serial":')
.replace(/LABEL=/g, ',"label":')
.replace(/MODEL=/g, ',"model":')
.replace(/OWNER=/g, ',"owner":')
.replace(/\n/g, '}\n');
}
function blockDevices(callback) { function blockDevices(callback) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
process.nextTick(() => { process.nextTick(() => {
if (_windows) { if (_windows) {
let error = new Error(NOT_SUPPORTED); let error = new Error(NOT_SUPPORTED);
if (callback) { callback(NOT_SUPPORTED) } if (callback) {
callback(NOT_SUPPORTED)
}
reject(error); reject(error);
} }
if (_linux) { if (_linux) {
// see https://wiki.ubuntuusers.de/lsblk/ // see https://wiki.ubuntuusers.de/lsblk/
// exec("lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,SCHED,RQ-SIZE,RA,WSAME", function (error, stdout) { // exec("lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,SCHED,RQ-SIZE,RA,WSAME", function (error, stdout) {
exec("lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,TRAN,SERIAL,LABEL,MODEL,OWNER", function (error, stdout) { exec("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER", function (error, stdout) {
let data = []; let data = [];
if (!error) { if (!error) {
let lines = stdout.toString().split('\n'); let lines = blkStdoutToObject(stdout).split('\n');
data = parseBlk(lines); data = parseBlk(lines);
if (callback) { if (callback) {
callback(data) callback(data)
} }
resolve(data); resolve(data);
} else { } else {
exec("lsblk -bo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,LABEL,MODEL,OWNER", function (error, stdout) { exec("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER", function (error, stdout) {
if (!error) { if (!error) {
let lines = stdout.toString().split('\n'); let lines = blkStdoutToObject(stdout).split('\n');
data = parseBlk(lines); data = parseBlk(lines);
} }
if (callback) { if (callback) {
@ -207,7 +214,6 @@ function blockDevices(callback) {
}); });
} }
if (_darwin) { if (_darwin) {
// last minute decision to remove code ... not stable
exec("diskutil info -all", function (error, stdout) { exec("diskutil info -all", function (error, stdout) {
let data = []; let data = [];
if (!error) { if (!error) {
@ -279,7 +285,9 @@ function fsStats(callback) {
process.nextTick(() => { process.nextTick(() => {
if (_windows) { if (_windows) {
let error = new Error(NOT_SUPPORTED); let error = new Error(NOT_SUPPORTED);
if (callback) { callback(NOT_SUPPORTED) } if (callback) {
callback(NOT_SUPPORTED)
}
reject(error); reject(error);
} }
@ -324,11 +332,15 @@ function fsStats(callback) {
}); });
result = calcFsSpeed(rx, wx); result = calcFsSpeed(rx, wx);
} }
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
}) })
} else { } else {
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
} }
}) })
@ -348,7 +360,9 @@ function fsStats(callback) {
}); });
result = calcFsSpeed(rx, wx); result = calcFsSpeed(rx, wx);
} }
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
}) })
} }
@ -360,7 +374,9 @@ function fsStats(callback) {
result.rx_sec = _fs_speed.rx_sec; result.rx_sec = _fs_speed.rx_sec;
result.wx_sec = _fs_speed.wx_sec; result.wx_sec = _fs_speed.wx_sec;
result.tx_sec = _fs_speed.tx_sec; result.tx_sec = _fs_speed.tx_sec;
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
} }
}); });
@ -415,7 +431,9 @@ function disksIO(callback) {
process.nextTick(() => { process.nextTick(() => {
if (_windows) { if (_windows) {
let error = new Error(NOT_SUPPORTED); let error = new Error(NOT_SUPPORTED);
if (callback) { callback(NOT_SUPPORTED) } if (callback) {
callback(NOT_SUPPORTED)
}
reject(error); reject(error);
} }
@ -452,10 +470,14 @@ function disksIO(callback) {
}); });
result = calcDiskIO(rIO, wIO); result = calcDiskIO(rIO, wIO);
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
} else { } else {
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
} }
}); });
@ -475,7 +497,9 @@ function disksIO(callback) {
}); });
result = calcDiskIO(rIO, wIO); result = calcDiskIO(rIO, wIO);
} }
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
}) })
} }
@ -487,7 +511,9 @@ function disksIO(callback) {
result.rIO_sec = _disk_io.rIO_sec; result.rIO_sec = _disk_io.rIO_sec;
result.wIO_sec = _disk_io.wIO_sec; result.wIO_sec = _disk_io.wIO_sec;
result.tIO_sec = _disk_io.tIO_sec; result.tIO_sec = _disk_io.tIO_sec;
if (callback) { callback(result) } if (callback) {
callback(result)
}
resolve(result); resolve(result);
} }
}); });

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // graphics.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -4,13 +4,14 @@
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Contributors: Guillaume Legrain (https://github.com/glegrain) // Contributors: Guillaume Legrain (https://github.com/glegrain)
// Riccardo Novaglia (https://github.com/richy24) // Riccardo Novaglia (https://github.com/richy24)
// Quentin Busuttil (https://github.com/Buzut) // Quentin Busuttil (https://github.com/Buzut)
// Lapsio (https://github.com/lapsio) // Lapsio (https://github.com/lapsio)
// csy (https://github.com/csy1983)
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT
// ================================================================================== // ==================================================================================
@ -81,6 +82,7 @@
// -------------------------------- // --------------------------------
// //
// version date comment // version date comment
// 3.16.0 2017-01-19 blockDevices: added removable attribute + fix
// 3.15.1 2017-01-17 minor cpuTemperature fix (OSX) // 3.15.1 2017-01-17 minor cpuTemperature fix (OSX)
// 3.15.0 2017-01-15 added cpuTemperature also for OSX // 3.15.0 2017-01-15 added cpuTemperature also for OSX
// 3.14.0 2017-01-14 added currentLoad per cpu/core, cpu cache (L1, L2, L3) and cpu flags // 3.14.0 2017-01-14 added currentLoad per cpu/core, cpu cache (L1, L2, L3) and cpu flags

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // internet.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // memory.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // network.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,17 +1,12 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // osinfo.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Contributors: Guillaume Legrain (https://github.com/glegrain)
// Riccardo Novaglia (https://github.com/richy24)
// Quentin Busuttil (https://github.com/Buzut)
// Lapsio (https://github.com/lapsio)
// ----------------------------------------------------------------------------------
// License: MIT // License: MIT
// ================================================================================== // ==================================================================================
// 3. Operating System // 3. Operating System
@ -152,14 +147,8 @@ function osInfo(callback) {
exports.osInfo = osInfo; exports.osInfo = osInfo;
function versions(callback) { function versions(callback) {
return new Promise((resolve, reject) => { return new Promise((resolve) => {
process.nextTick(() => { process.nextTick(() => {
if (_windows) {
let error = new Error(NOT_SUPPORTED);
if (callback) { callback(NOT_SUPPORTED) }
reject(error);
}
let result = { let result = {
kernel: os.release(), kernel: os.release(),
node: process.versions.node, node: process.versions.node,

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // processes.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,17 +1,12 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // system.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Contributors: Guillaume Legrain (https://github.com/glegrain)
// Riccardo Novaglia (https://github.com/richy24)
// Quentin Busuttil (https://github.com/Buzut)
// Lapsio (https://github.com/lapsio)
// ----------------------------------------------------------------------------------
// License: MIT // License: MIT
// ================================================================================== // ==================================================================================
// 2. System (Hardware) // 2. System (Hardware)

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // users.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT

View File

@ -1,10 +1,10 @@
'use strict'; 'use strict';
// ================================================================================== // ==================================================================================
// index.js // utils.js
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// Description: System Information - library // Description: System Information - library
// for Node.js // for Node.js
// Copyright: (c) 2014 - 2016 // Copyright: (c) 2014 - 2017
// Author: Sebastian Hildebrandt // Author: Sebastian Hildebrandt
// ---------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------
// License: MIT // License: MIT