os-uptime

2.0.2 • Public • Published

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. See #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

Package Sidebar

Install

npm i os-uptime

Weekly Downloads

47

Version

2.0.2

License

MIT

Unpacked Size

4.71 kB

Total Files

7

Last publish

Collaborators

  • oroce