@ekristoffe/node-disk-info
Version:
Node module to get disk information in Windows, Linux & Mac. It works with Electron.
27 lines (23 loc) • 586 B
text/typescript
import * as os from 'os';
import {execSync} from 'child_process';
/**
* Class with utilitary methods.
*/
export class Utils {
/**
* Detects current platform.
*
* @return {string} Platform: win32, linux, darwin.
*/
public static detectPlatform(): string {
return os.platform().toLowerCase();
}
/**
* Executes a command in SO console.
*
* @param {string} command: Command to execute.
*/
public static execute(command: string): string {
return execSync(command).toString();
}
}