platform-name
v1.0.0
Published
Convert a Node.js platform identifier into a human-readable platform name: `openbsd` → `OpenBSD`
Downloads
1,227
Maintainers
Readme
platform-name
Convert a Node.js platform identifier into a human-readable platform name
const platformName = require('platform-name');
platformName('aix'); //=> 'AIX'
platformName('android'); //=> 'Android'
platformName('darwin'); //=> 'macOS'
platformName('freebsd'); //=> 'FreeBSD'
platformName('linux'); //=> 'Linux'
platformName('openbsd'); //=> 'OpenBSD'
platformName('sunos'); //=> 'Solaris'
platformName('win32'); //=> 'Windows'
Installation
npm install platform-name
API
const platformName = require('platform-name');
platformName([id])
id: string
(one of aix
android
darwin
freebsd
linux
openbsd
sunos
win32
)
Return: string
Uses process.platform
when it takes no arguments.
//On macOS
platformName('linux'); //=> 'Linux'
platformName(); //=> 'macOS'
platformName.map
Type: Map
ID-name pairs used inside this module.
platformName.map.get('win32'); //=> 'Windows'
License
ISC License © 2018 Shinnosuke Watanabe