JSPM

  • Created
  • Published
  • Downloads 5222435
  • Score
    100M100P100Q213407F
  • License ISC

Get the OS/Distribution name of the environment you are working on

Package Exports

  • getos

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 (getos) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

GETOS

A simple npm utility to supplement os.platform()

Problem

os.platform() returns linux. If you want the distrubtion name, you are S.O.L.

Solution

This. Simply call

var getos = require('getos')

getos(function(e,os) {
  if(e) return console.log(e)
  console.log("Your OS is:" +os)
})

Disclaimer

Check os.json in this repo. Any distribution that shares a common resource file with another distrubtion is currently untested. These are the arrays of distrubitons with more than 1 member. If you are using one of these distrubtions, please submit an issue letting me know if it works. If it fails, please post the content of the file.

If you have a distrubtion not in os.json, please identify your resource file and submit it's name and content along with your distrbution/version in an issue.

Thanks for helping make this tool great.