App.js
// credits : inspired by  hemant both sleep-mode and power-off Licence MIT
credits : inspired by  hemant both sleep-mode and power-off Licence MIT
credits : inspired by hemant both sleep - mode and power - off Licence MIT
function poweroff(cb) {
    var cmd = '';
	if(isLinux() || isOsx()) {
		cmd = 'sudo shutdown -h now';
	} else if(isWindows()) {
		cmd = 'shutdown -s -t 0';
	} else {
		throw new Error('Unknown OS!');
	}
	cp.exec(cmd,  (err, stdout, stderr) => {
		cb(err, stdout, stderr);
	});
}
function poweroff ( cb ) { var cmd = '' ; if ( isLinux ( ) || isOsx ( ) ) { cmd = 'sudo shutdown -h now' ; } else if ( isWindows ( ) ) { cmd = 'shutdown -s -t 0' ; } else { throw new Error ( 'Unknown OS!' ) ; } cp . exec ( cmd , ( err , stdout , stderr ) => { cb ( err , stdout , stderr ) ; } ) ; }
credits : inspired by  hemant both sleep-mode and power-off Licence MIT
credits : inspired by hemant both sleep - mode and power - off Licence MIT