UNPKG

@augment-vir/node

Version:

A collection of augments, helpers types, functions, and classes only for Node.js (backend) JavaScript environments.

40 lines (39 loc) 1.15 kB
/** * The three major operating system types. * * @category Node : OS * @category Package : @augment-vir/node * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node) */ export declare enum OperatingSystem { Linux = "linux", Mac = "mac", Windows = "windows" } /** * The current operating system type, as deduced from * [`process.platform`](https://nodejs.org/api/process.html#processplatform). * * @category Node : OS * @category Package : @augment-vir/node * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node) */ export declare const currentOperatingSystem: OperatingSystem; /** * Checks if the current operating system is the requested one. * * @category Node : OS * @category Package : @augment-vir/node * @example * * ```ts * import {isOperatingSystem, OperatingSystem} from '@augment-vir/node'; * * if (isOperatingSystem(OperatingSystem.Mac)) { * // do something * } * ``` * * @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node) */ export declare function isOperatingSystem(operatingSystem: OperatingSystem): boolean;