JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 640
  • Score
    100M100P100Q105080F
  • License CC0-1.0

Convert a Node.js platform identifier to the human-readable platform name: `openbsd` → `OpenBSD`

Package Exports

  • platform-name

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (platform-name) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

platform-name

NPM version Build Status Coverage Status

Convert a Node.js platform identifier to the 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

Use npm.

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'

License

Creative Commons Zero v1.0 Universal