New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

linux-release-info

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linux-release-info

Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Darwin it only returns common node os module info (platform, hostname, release and arch)

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

linux-release-info

Get Linux release info (distribution name, version, arch, release, etc.) from '/etc/os-release' file and from native os module. On Windows and Darwin it only returns common node os module info (platform, hostname, release and arch)

###Highlights

  • Lightweight without any dependecies (only native node modules)
  • Async file reading

Installation

npm install --save linux-release-info

Usage

const releaseInfo = require('linux-release-info')

releaseInfo()
    .then(result => {
        console.log(`You are using ${result.pretty_name} on a ${result.arch} machine`) // Distro name (only on linux) and arch info
        console.log(result) // all data
    })
    .catch(err => console.error(`Error reading OS release info: ${err}`))

Outputs:

> You are using Ubuntu 17.10 on a x64 machine
Sample outputs

Linux

{ type: 'Linux',
  platform: 'linux',
  hostname: 'VirtualBoxLINUX',
  arch: 'x64',
  release: '4.13.0-32-generic',
  name: 'Ubuntu',
  version: '17.10 (Artful Aardvark)',
  id: 'ubuntu',
  id_like: 'debian',
  pretty_name: 'Ubuntu 17.10',
  version_id: '17.10',
  home_url: 'https://www.ubuntu.com/',
  support_url: 'https://help.ubuntu.com/',
  bug_report_url: 'https://bugs.launchpad.net/ubuntu/',
  privacy_policy_url: 'https://www.ubuntu.com/legal/terms-and-policies/privacy-policy',
  version_codename: 'artful',
  ubuntu_codename: 'artful' }

Linux (Raspberry Pi)

{ type: 'Linux',
  platform: 'linux',
  hostname: 'raspberrypi',
  arch: 'arm',
  release: '4.9.59-v7+',
  pretty_name: 'Raspbian GNU/Linux 9 (stretch)',
  name: 'Raspbian GNU/Linux',
  version_id: '9',
  version: '9 (stretch)',
  id: 'raspbian',
  id_like: 'debian',
  home_url: 'http://www.raspbian.org/',
  support_url: 'http://www.raspbian.org/RaspbianForums',
  bug_report_url: 'http://www.raspbian.org/RaspbianBugs' }

Windows

{ type: 'Windows_NT',
  platform: 'win32',
  hostname: 'MYPC',
  arch: 'x64',
  release: '10.0.16299' }

License

Licensed under MIT

Copyright (c) 2018 [Samuel Carreira]

Keywords

FAQs

Package last updated on 10 Feb 2018

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