i have a small problem in creating javascript.
i have a js which spawn shell script(expect, which ssh another computer, and send some data back to nodejs.
i have problem in multithreading.
var cons = spawn('./somescript');
var content;
cons.stdout.on('data', function(block)
{
content += block;
mrdialist = JSON.parse(block);
....
console.log("" + block);
});
console.log("hjdfsdf");
here is some actions with loaded and parced data.
but when i try to execute jscript, it start from the beginning, and make all actions through loading data without loading and parsing, how can i continue execution of the code onlu, after execution
console.log("" + block);
});
console.log("hjdfsdf");