@nexssp/os
Detect Linux
distro name and version, check if user is root, and some other info. Also works for Windows showing name as Windows
and version like 10.0.19041
Distros list
distrosList {
ALPINE: 'Alpine Linux',
AMAZON: 'Amazon Linux',
ARCH: 'Arch Linux',
CENTOS: 'CentOS Linux',
DEBIAN: 'Debian',
FEDORA: 'Fedora',
MINT: 'Mint Linux',
ORACLE: 'Oracle Linux Server',
RHEL: 'RHEL Linux',
SUSE_LEAP: 'openSUSE Leap',
SUSE_TUMBLEWEED: 'openSUSE Tumbleweed',
UBUNTU: 'UBUNTU'
}
Examples
const os = require('@nexssp/os');
console.log('distrosList', os.distros);
console.log('isRoot: ', os.isRoot());
console.log('name: ', os.name());
console.log('get("name"): ', os.get('NAME'));
console.log('v: ', os.v());
console.log('get("VERSION_ID"): ', os.get('VERSION_ID'));
console.log('get("VERSION_IDxxx"): ', os.get('VERSION_IDxxx'));
console.log('get()', os.get());
console.log('getPM("install"):', os.getPM());
console.log('getPM("update"):', os.getPM('update'));