Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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