A Node.js module that returns the OS/Distribution name of the environment you are working on
Installations
npm install getos
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.20.1
NPM Version
6.14.4
Score
99.1
Supply Chain
93.3
Quality
80
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (79.04%)
Dockerfile (20.96%)
Developer
retrohacker
Download Statistics
Total Downloads
942,978,588
Last Day
1,022,996
Last Week
4,541,413
Last Month
20,132,499
Last Year
260,450,232
GitHub Statistics
79 Stars
226 Commits
26 Forks
10 Watching
17 Branches
21 Contributors
Bundle Size
29.76 kB
Minified
9.29 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.2.1
Package Id
getos@3.2.1
Size
15.19 kB
NPM Version
6.14.4
Node Version
10.20.1
Publised On
19 May 2020
Total Downloads
Cumulative downloads
Total Downloads
942,978,588
Last day
-1.4%
1,022,996
Compared to previous day
Last week
-13.7%
4,541,413
Compared to previous week
Last month
4%
20,132,499
Compared to previous month
Last year
4.3%
260,450,232
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
getos
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:
1var getos = require('getos') 2 3getos(function(e,os) { 4 if(e) return console.log(e) 5 console.log("Your OS is:" +JSON.stringify(os)) 6})
The os
object conforms to:
1{ 2 os: [OS NAME], 3 dist:[DIST NAME], 4 codename:[CODENAME], 5 release:[VERSION] 6}
For example:
1{ 2 os: "linux", 3 dist: "Ubuntu", 4 codename: "precise", 5 release: "12.04" 6}
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:
Benjamin E. Coe | GitHub/bcoe | Twitter/@benjamincoe |
---|---|---|
Eugene Sharygin | GitHub/eush77 | Twitter/@eush77 |
David Routhieau | GitHub/root-io | unknown |
Lawrence | GitHub/mindmelting | Twitter/@mindmelting |
Roman Jurkov | GitHub/winfinit | Twitter/@winfinit |
Rod Vagg | GitHub/rvagg | Twitter/@rvagg |
Zeke Sikelianos | GitHub/zeke | Twitter/@zeke |
Alexander | GitHub/alex4Zero | Twitter/@alex4Zero |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 6/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating debian:7.4 to debian:7.4@sha256:c0a108aed0b5eb62177ef81a1e0473192f1c451ff710acde3360e400b11bcbc1
- Warn: containerImage not pinned by hash: tests/alpine/3.3/Dockerfile:1: pin your Docker image by updating alpine:3.3 to alpine:3.3@sha256:6bff6f65597a69246f79233ef37ff0dc50d97eaecbabbe4f8a885bf358be1ecf
- Warn: containerImage not pinned by hash: tests/debian/7.3/Dockerfile:1: pin your Docker image by updating debian:7.3 to debian:7.3@sha256:70b85ddb5a82bf1a1b3e9938747788602b85e2c7ba1713da5ac9997744be7c58
- Warn: containerImage not pinned by hash: tests/debian/7.4/Dockerfile:1: pin your Docker image by updating debian:7.4 to debian:7.4@sha256:c0a108aed0b5eb62177ef81a1e0473192f1c451ff710acde3360e400b11bcbc1
- Warn: containerImage not pinned by hash: tests/debian/7.5/Dockerfile:1: pin your Docker image by updating debian:7.5 to debian:7.5@sha256:129cf957db7007eb63d722bfc155db30c6407569f4cb6f074d34b0e400f93776
- Warn: containerImage not pinned by hash: tests/debian/7.6/Dockerfile:1: pin your Docker image by updating debian:7.6 to debian:7.6@sha256:ca8972735c90554dd049cde1cb839c9462cb2d80ff8655a4b7a3294d579f5407
- Warn: containerImage not pinned by hash: tests/fedora/20/Dockerfile:1: pin your Docker image by updating fedora:20 to fedora:20@sha256:5d5a02b873d298da9bca4b84440c5cd698b0832560c850d92cf389cef58bc549
- Warn: containerImage not pinned by hash: tests/ubuntu/13.10/Dockerfile:1: pin your Docker image by updating ubuntu:13.10 to ubuntu:13.10@sha256:403105e61e2d540187da20d837b6a6e92efc3eb4337da9c04c191fb5e28c44dc
- Warn: containerImage not pinned by hash: tests/ubuntu/14.04/Dockerfile:1: pin your Docker image by updating ubuntu:14.04 to ubuntu:14.04@sha256:64483f3496c1373bfd55348e88694d1c4d0c9b660dee6bfef5e12f43b9933b30
- Warn: downloadThenRun not pinned by hash: Dockerfile:13
- Warn: downloadThenRun not pinned by hash: tests/debian/7.3/Dockerfile:13
- Warn: downloadThenRun not pinned by hash: tests/debian/7.4/Dockerfile:13
- Warn: downloadThenRun not pinned by hash: tests/debian/7.5/Dockerfile:13
- Warn: downloadThenRun not pinned by hash: tests/debian/7.6/Dockerfile:13
- Warn: downloadThenRun not pinned by hash: tests/ubuntu/13.10/Dockerfile:11
- Warn: downloadThenRun not pinned by hash: tests/ubuntu/14.04/Dockerfile:11
- Info: 0 out of 9 containerImage dependencies pinned
- Info: 0 out of 7 downloadThenRun dependencies pinned
Score
3.5
/10
Last Scanned on 2025-01-20
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to getos
@types/getos
TypeScript definitions for getos
getos-cli
Detect and Print OS name cross-platform
picluster-getos
Get the OS/Distribution name of the environment you are working on
getoslocalescrossplatform
A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers