UNPKG

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