Skip to content
Permalink
v0.1.0
Go to file
 
 
Cannot retrieve contributors at this time
25 lines (20 sloc) 547 Bytes
'use strict';
var exec = require('child_process').exec,
delimiter = ': ',
callback = function () {},
stdoutHandler = function (error, stdout) {
if (error !== null) {throw error;}
callback(stdout.slice(stdout.indexOf(delimiter) + 2));
};
module.exports = function (cb) {
callback = cb;
switch (process.platform) {
case 'darwin':
exec('system_profiler SPHardwareDataType | grep \'Serial\'', stdoutHandler);
break;
case 'win32':
delimiter = '\r\n';
exec('wmic csproduct get identifyingnumber', stdoutHandler);
break;
}
};
You can’t perform that action at this time.