Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alex2844/node-osinfo
Get the OS information
https://github.com/alex2844/node-osinfo
Last synced: 10 days ago
JSON representation
Get the OS information
- Host: GitHub
- URL: https://github.com/alex2844/node-osinfo
- Owner: alex2844
- Created: 2018-05-31T12:29:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T15:22:57.000Z (over 6 years ago)
- Last Synced: 2024-04-24T23:01:12.376Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-osinfo
[![Version](https://img.shields.io/npm/v/node-osinfo.svg)](https://www.npmjs.org/package/node-osinfo)
Get the OS/Distribution name of the environment you are working on
Available in Linux and Windows.
``` javascript
var osinfo = require('node-osinfo');
osinfo(function(res) {
console.log(res);
});
```
``` javascript
var osinfo = require('node-osinfo');
osinfo().then(function(res) {
console.log(res);
});
```
``` log
{ platform: 'Windows', distro: 'Microsoft Windows 7 Professional', release: 7, kernel: '6.1.7601', arch: 'ia32', hostname: 'localhost', user: { uid: -1, gid: -1, username: 'alex', homedir: 'C:\\users\\alex', shell: null } }
{ platform: 'linux', distro: 'Ubuntu', release: '16.04', kernel: '3.8.11', arch: 'x64', hostname: 'localhost', user: { uid: 1000, gid: 1000, username: 'alex', homedir: '/home/alex', shell: '/bin/bash' } }
{ platform: 'linux', distro: 'Chrome OS', release: '65', kernel: '3.8.11', arch: 'x64', hostname: 'localhost', user: { uid: 1000, gid: 1000, username: 'chronos', homedir: '/home/chronos/user', shell: '/bin/bash' } }
```## Installation
```
npm install -g node-osinfo
```