You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/OS.ts

19 lines
525 B
TypeScript

import os from 'os';
import _ from 'lodash';
import semver from 'semver';
export const isMacOS = () => process.platform === 'darwin';
export const isLinux = () => process.platform === 'linux';
export const isWindows = (minVersion?: string) => {
const osRelease = os.release();
if (process.platform !== 'win32') {
return false;
}
return _.isUndefined(minVersion) ? true : semver.gte(osRelease, minVersion);
};
export const getOSArchitecture = () => os.arch();
export const getOSPlatform = () => os.platform();