Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oroce/node-os-uptime
get operating system's uptime as a date, darwin and linux supported
https://github.com/oroce/node-os-uptime
Last synced: about 2 months ago
JSON representation
get operating system's uptime as a date, darwin and linux supported
- Host: GitHub
- URL: https://github.com/oroce/node-os-uptime
- Owner: oroce
- License: mit
- Created: 2016-07-15T20:33:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-01T18:08:11.000Z (over 6 years ago)
- Last Synced: 2024-10-22T21:25:16.692Z (2 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
os-uptime
=====Get operating system's uptime as a date.
For each platform a different command is used to retrieve the uptime as a date. The commands are as follows:
* linux - `uptime -s`
* darwin - `sysctl -n kern.boottime`
* win32 - `net statistics workstation`---
You might also be interested in Node.js’s native [`os.uptime()` method](https://nodejs.org/api/os.html#os_os_uptime). See [#1](https://github.com/oroce/node-os-uptime/issues/1) for reasons to use this package instead.
# Install
```
npm install os-uptime
```# Usage
```
const uptime = require('os-uptime');console.log('System was started at: %s', uptime().toLocaleString());
```# LICENSE
MIT