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 = ; pc; //return { free: number, total: number }
Hostname Return the computer's hostname
pchostname; //return { name: 'string' }
Uptime Return the system uptime in seconds
pc //return { time: 'string' }
tmpDir Returns the operating system's default directory for temp files.
pc //return { location: 'string' }
NetworkInterfaces Get a list of network interfaces
pc; /* { lo0: [ { address: '::1', family: 'IPv6', internal: true }, { address: 'fe80::1', family: 'IPv6', internal: true }, { address: '127.0.0.1', family: 'IPv4', internal: true } ], en1: [ { address: 'fe80::cabc:c8ff:feef:f996', family: 'IPv6', internal: false }, { address: '10.0.1.123', family: 'IPv4', internal: false } ], vmnet1: [ { address: '10.99.99.254', family: 'IPv4', internal: false } ], vmnet8: [ { address: '10.88.88.1', family: 'IPv4', internal: false } ], ppp0: [ { address: '10.2.0.231', family: 'IPv4', internal: false } ] } */
The rest of the api return promises
I like to define an error handler function to deal with my promises errors,
var { console; throw err; };
cpu Returns an objects containing information about each CPU/core installed.
pc; /*return { deviceId: 'string', status: number, currentClockSpeed: number, currentVoltage: number, loadPercentage: number, maxClockSpeed: number, name: 'string', numberOfCores: number, processorId: 'string' }*/
Public IP Return the public IP of the computer. Internet connection is required to call this method.
pc;
Drives Return an array of object with drive information.
pc;
Users Return an array of existing users in the computer.
pc;
Mac Return an array of nic info.
pc;
Programs Return an array with all the applications installed in the computer.
pc;
Programs Return an array with all shares in the computer.
pc;
Useful Methods
getAll Retrieve all the information from the computer
pc;
get Get an object with selected attributes
pc