@darthcav/ts-utils
    Preparing search index...

    Function osRelease

    • 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).

      Returns OsRelease | null

      An OsRelease object on supported platforms, or null when the platform is unsupported or /etc/os-release is absent on Linux.

      import { osRelease } from "@darthcav/ts-utils"

      const info = 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)