var exec = require('child_process').exec; exec('R', function callback(error, stdout, stderr){ // result });