I open curl to download some ISO at the background and inform the client about the progress. Since curl, wget and many others clear output. I want the output of curl to be seen at browser. I cannot exactly pipe it because the browser will not understand, It is basically changing the output data via ncurses or something I dont know. How can I solve this?
var spawn = require('child_process').spawn,
curl = spawn('curl', ['-oubuntu.iso','http://releases.ubuntu.com/10.04/ubuntu-10.04.4-desktop-i386.iso']);
curl.stderr.pipe(process.stdout); // Works perfectly:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
1 694M 1 13.5M 0 0 2193k 0 0:05:24 0:00:06 0:05:18 2439k
But process.on("data") is not consistent, random number changes new lines etc..