Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nexssp/os

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nexssp/os

Get distro name, version..

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
decreased by-57.24%
Maintainers
1
Weekly downloads
 
Created
Source

@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');

// Distros
console.log('distrosList', os.distros);
console.log('isRoot: ', os.isRoot()); // true or false
console.log('name: ', os.name()); // eg. Ubuntu
console.log('get("name"): ', os.get('NAME')); // eg. Ubuntu
console.log('v: ', os.v()); // eg. 18.04
console.log('get("VERSION_ID"): ', os.get('VERSION_ID')); // eg. 18.04
console.log('get("VERSION_IDxxx"): ', os.get('VERSION_IDxxx')); // undfinded
console.log('get()', os.get()); // display all available data - depended of Linux distro

// Package managers
console.log('getPM("install"):', os.getPM()); // Displays install command
console.log('getPM("update"):', os.getPM('update')); // Displays update command

FAQs

Package last updated on 20 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc