index.d.ts 683 B

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