get system release in typescript

To get the system release information in typescript, you can use the systeminformation library in Node.js. First, install the library by running npm install systeminformation.

Then, you can use the osInfo() function to get the OS information, including the release version. Here's an example:

index.ts
import si from 'systeminformation';

async function getSystemRelease() {
  const osInfo = await si.osInfo();
  const systemRelease = osInfo.release;
  console.log(systemRelease);
  return systemRelease;
}

getSystemRelease();
226 chars
11 lines

This will output the system release version, and also return it as a string.

gistlibby LogSnag