Returns OS release information for the current platform, or null on unsupported
platforms or when /etc/os-release is absent on Linux.
On Linux, name, version, and arch are normalized from NAME/PRETTY_NAME,
VERSION_ID/VERSION, and os.arch() respectively. All raw keys from
/etc/os-release are also present on the returned object.
On Windows, distinguishes Windows 11 from Windows 10 by NT build number
(>= 22000 → Windows 11).
An OsRelease object on supported platforms, or null when
the platform is unsupported or /etc/os-release is absent on Linux.
Example
import { osRelease } from"@darthcav/ts-utils"
constinfo = osRelease() if (info) console.log(info.name) // e.g. "Ubuntu" or "Windows 11" if (info) console.log(info.PRETTY_NAME) // e.g. "Ubuntu 24.04 LTS" (Linux only)
Returns OS release information for the current platform, or
nullon unsupported platforms or when/etc/os-releaseis absent on Linux.On Linux,
name,version, andarchare normalized fromNAME/PRETTY_NAME,VERSION_ID/VERSION, andos.arch()respectively. All raw keys from/etc/os-releaseare also present on the returned object.On Windows, distinguishes Windows 11 from Windows 10 by NT build number (>= 22000 → Windows 11).