Skip to content

oroce/node-os-uptime

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

get operating system's uptime as a date, darwin and linux supported

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •