PC
An application that provides information about a computer. Such as available memory, installed application, drives spaces, etc. It is only supporting Windows right now but Linux and Mac support are coming soon.
##Install
npm install pc
Information Available
- Memory
- CPU
- Hostname
- Uptime
- NetworkInterfaces
- Temporary Directory
- Public IP
- Drives
- Users
- MAC
- Programs
- Share
- More coming soon
Methods
Memory Return computer's available memory
var pc = require('pc');
pc.memory();
Hostname Return the computer's hostname
pc.hostname();
Uptime Return the system uptime in seconds
pc.uptime()
tmpDir Returns the operating system's default directory for temp files.
pc.tmpDir()
NetworkInterfaces Get a list of network interfaces
pc.networkInterfaces();
###The rest of the api return promises
I like to define an error handler function to deal with my promises errors,
var errorHandler = function(err){ console.log(err); throw err; };
cpu Returns an objects containing information about each CPU/core installed.
pc.cpu().then(function(cpu){
console.log(cpu);
}, errorHandler);
Public IP Return the public IP of the computer. Internet connection is required to call this method.
pc.publicIP().then(function(ipInfo){
console.log(ipInfo);
}, errorHandler);
Drives Return an array of object with drive information.
pc.drives().then(function(drives){
console.log(drives);
}, errorHandler);
Users Return an array of existing users in the computer.
pc.users().then(function(users){
console.log(users);
}, errorHandler);
Mac Return an array of nic info.
pc.mac().then(function(list){
console.log(list);
}, errorHandler);
Programs Return an array with all the applications installed in the computer.
pc.programs().then(function(list){
console.log(list);
}, errorHandler);
Programs Return an array with all shares in the computer.
pc.share().then(function(list){
console.log(list);
}, errorHandler);
Useful Methods
getAll Retrieve all the information from the computer
pc.getAll().then(function(everything){
console.log(everything)
}, errorHandler);
get Get an object with selected attributes
pc.get(['mac, publicIP, users']).then(function(results){
console.log(results);
}, errorHandler)