I\'m trying to return the output of this function as a string, but it keeps returning as undefined. Where am I going wrong?
function run(cmd){ var spawn
var spawn = require('child_process').spawn, command = spawn('ls', ['/tmp/']); command.stdout.pipe(process.stdout);
The following link is exactly the same question as yours.