I am developing a simple web app to upload stuff to google bucket. I am using child_process.exec method to fire the upload command, the command is as follows,
child = exec(command, function (error,
stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
});
command = /Users/nachiketjoshi/google-cloud-sdk/bin/bootstrapping/gsutil.py cp -r /Users/nachiketjoshi/Desktop/shell-upload-sample gs://bucket-name
The problem I am facing is that the console output in the web app shows the entire status after the file is uploaded.
I want to see the output just like the command line utility shows while uploading that is with a status bar and percentage and everything.
Currently, with above child_process I can see something as follows on the web app console.
[2 files][ 10.0 MiB/ 30.0 MiB] 664.3 KiB/s
\
\ [2 files][ 10.5 MiB/ 30.0 MiB] 585.3 KiB/s
|
| [2 files][ 11.0 MiB/ 30.0 MiB] 525.7 KiB/s
/
/ [2 files][ 11.6 MiB/ 30.0 MiB] 476.7 KiB/s
[2 files][ 12.1 MiB/ 30.0 MiB] 439.3 KiB/s
\
|
| [2 files][ 12.8 MiB/ 30.0 MiB] 511.6 KiB/s
/
/ [2 files][ 13.9 MiB/ 30.0 MiB] 595.3 KiB/s
[2 files][ 14.7 MiB/ 30.0 MiB] 660.8 KiB/s
\
\ [2 files][ 15.2 MiB/ 30.0 MiB] 538.9 KiB/s
|
/
/ [2 files][ 15.7 MiB/ 30.0 MiB] 424.6 KiB/s
[2 files][ 16.2 MiB/ 30.0 MiB] 339.7 KiB/s
\
\ [2 files][ 16.7 MiB/ 30.0 MiB] 408.2 KiB/s
|
/
/ [2 files][ 17.2 MiB/ 30.0 MiB] 427.0 KiB/s
\
\ [2 files][ 18.0 MiB/ 30.0 MiB] 415.3 KiB/s
|
/
/ [2 files][ 18.5 MiB/ 30.0 MiB] 394.7 KiB/s
\
\ [2 files][ 19.0 MiB/ 30.0 MiB] 403.4 KiB/s
|
| [2 files][ 19.5 MiB/ 30.0 MiB] 371.9 KiB/s
/
/ [2 files][ 20.3 MiB/ 30.0 MiB] 433.6 KiB/s
Operation completed over 3 objects/30.0 MiB.
What exactly does above output mean?
What changes should I make so that I can see the proper 'live output' on my web console?