var process = require('child_process');

process.exec('ls -af',function (error, stdout, stderr) {
if (error !== null) {
console.log('exec error: ' + error);
}
console.log(stdout);

});