linux-os-release
Version:
Reads Linux operating system identification data
39 lines (30 loc) • 1.05 kB
Markdown
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).
```bash
npm install linux-os-release
```
```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'
// }
```
MIT