An open API service indexing awesome lists of open source software.

https://github.com/samuelmaddock/linux-os-release

Reads Linux operating system identification data
https://github.com/samuelmaddock/linux-os-release

Last synced: 11 months ago
JSON representation

Reads Linux operating system identification data

Awesome Lists containing this project

README

          

# linux-os-release

A Node.js library for reading Linux operating system identification data from `/etc/os-release` and `/usr/lib/os-release` files according to the [freedesktop.org specification](https://www.freedesktop.org/software/systemd/man/latest/os-release.html).

## Installation

```bash
npm install linux-os-release
```

## Usage

```js
import { readLinuxOSReleaseInfo } from 'linux-os-release';

// Read OS release info from standard locations
const osInfo = await readLinuxOSReleaseInfo();
console.log(osInfo);
// Output example:
// {
// NAME: 'Ubuntu',
// VERSION: '20.04.1 LTS (Focal Fossa)',
// ID: 'ubuntu',
// ID_LIKE: 'debian',
// PRETTY_NAME: 'Ubuntu 20.04.1 LTS',
// VERSION_ID: '20.04',
// 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: 'focal',
// UBUNTU_CODENAME: 'focal'
// }
```

## License

MIT