3.2.1 • Published 4 years ago

getos v3.2.1

Weekly downloads
2,116,336
License
MIT
Repository
github
Last release
4 years ago

getos

Greenkeeper badge

getos

Build Status npm.io npm.io npm.io npm.io npm.io

NPMNPM

JavaScript Style Guide

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

Problem

os.platform() returns linux. If you want the distrubtion name, you're out of luck.

Solution

This. Simply call:

var getos = require('getos')

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

The os object conforms to:

{
  os: [OS NAME],
  dist:[DIST NAME],
  codename:[CODENAME],
  release:[VERSION]
}

For example:

{
  os: "linux",
  dist: "Ubuntu",
  codename: "precise",
  release: "12.04"
}

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.

Unit Tests

Unit tests stub out the behaviour of the OS files and libraries we depend on to ensure the behaviour of the application is sound. You can run these simply by running npm test

Authors and Contributors

getos has been made possible by these fantastic contributors:

cypresscypress-runnerdev-env-setuppublishcommandtest@you54f/cypress@paiondata/nextwiki@everything-registry/sub-chunk-1754opennebula-cypress@dvcorg/cmlwargowellnessvulcan-nextvulcan-utilswillbetln-clizszilvai-cy-cloudvln-libvclass-libundockersweetalert2-denazification@easymetrics/mongodb-downloadrefinejs-reposetup-dev-envsentry-server-datasitespeed.ioss-actionssvavatar@kenshi.io/unchainedwmi-client-chinese@electron/fiddle-core@fanmiles/mongodb-download@fbricon/vscode-redhat-telemetry-nextreact-picky-with-clear@ruibaby/wiki@rapidsai/core@recordreplay/cypress@paulcbetts/linux-distro@please.dev/lib@namtoonix/editorjs-custom-multiple-selected@pxeeio/hygieia@vertedinde/fiddle-core@tresmo/mongodb-copy@trolls/expre55electron-fiddleem-neutron@krivega/cc@jaw-aid/npmpractice@lofcz/sweetalert2-neutraleditor.js-custom-multiple-selectededitorjs_forked@retailica/sweetalert2dupbit-api@hyperjumptech/monika@redhat-developer/vscode-redhat-telemetry@arist0tl3/mongodb-downloadfusebox-angular-universal-starter@aryanshridhar/fiddle-corefisheye-cypressfiddle-core@yak-spirit/yak-swap-ui@websvf/create-analysisfrea@zalastax/nolb-geto@abstraktor/actorjsgenially-cloudgetos-cliget-os-infoapache-rocketmqapache-rocketmq-chyapache-rocketmq-hotapache-rocketmq-lcapache-rocketmq-nodejsaoc-agenthadron-build@cantremember/mongodb-down-loadnext-plus-utilsinstall-rethinkdb-on-ubuntuinstall-arangodb-on-ubuntuinstall-cassandra-on-debiannext-exnode-pkg-installerj1-clinodejs-rocketmq-clientbrowserstack-node-sdkbluntlab-login-motdbluemix-workshopbmodulefortestingopenscriptkube-auth@arcblock/forge-cligoingnativenipenlpmcim-rocketmqnpmocnodus-server-managernuclidenode-red-contrib-amqpnode-red-contrib-amqp-acknode-red-contrib-amqp-credentials
3.2.1

4 years ago

3.2.0

4 years ago

3.1.5

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.4

4 years ago

3.1.1

5 years ago

3.1.0

6 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.8.4

7 years ago

2.8.3

7 years ago

2.8.2

8 years ago

2.8.0

8 years ago

2.7.0

8 years ago

2.6.2

8 years ago

2.6.1

8 years ago

2.6.0

8 years ago

2.5.0

8 years ago

2.4.0

9 years ago

2.3.0

9 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.1

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago