Hi so I have been using node-cmd(https://www.npmjs.com/package/node-cmd) to run some simple command like 'dir' etc and I would like to use the output outside of the function or store somewhere. I tried just storing it as a variable but it does not work. Hope someone can shed some light on this. Thanks!
var files="";
cmd.get('dir /b /a-d',function(err, data, stderr){
if(err){
console.log(err);
}
else {
console.log(data);
files = data;
}
});
console.log(files);