1 | /// <reference types="node"/>
|
2 |
|
3 | /**
|
4 | Get the name of the current operating system.
|
5 |
|
6 | By default, the name of the current operating system is returned.
|
7 |
|
8 | @param platform - Custom platform name.
|
9 | @param release - Custom release name.
|
10 |
|
11 | @example
|
12 | ```
|
13 | import * as os fron 'os';
|
14 | import osName = require('os-name');
|
15 |
|
16 | // On a macOS Sierra system
|
17 |
|
18 | osName();
|
19 | //=> 'macOS Sierra'
|
20 |
|
21 | osName(os.platform(), os.release());
|
22 | //=> 'macOS Sierra'
|
23 |
|
24 | osName('darwin', '14.0.0');
|
25 | //=> 'OS X Yosemite'
|
26 |
|
27 | osName('linux', '3.13.0-24-generic');
|
28 | //=> 'Linux 3.13'
|
29 |
|
30 | osName('win32', '6.3.9600');
|
31 | //=> 'Windows 8.1'
|
32 | ```
|
33 | */
|
34 | declare function osName(): string;
|
35 | declare function osName(platform: NodeJS.Platform, release: string): string;
|
36 |
|
37 | export = osName;
|