get system release in javascript

You can use the os module in Node.js to get the release information of the operating system running on the system. Here is an example code snippet:

index.tsx
const os = require('os');

const release = os.release();
console.log(`Operating system release: ${release}`);
110 chars
5 lines

The os.release() method returns a string that represents the operating system release. This string contains the version number and any other release information that the operating system provides. For example, on macOS, the release string might look like this: "20.4.0". On Linux, the release string might look like this: "4.15.0-91-generic".

gistlibby LogSnag