i write a node.js code just like below sample.
i use child_process.spawn to create child process for execute command 'wget'. at the same time i redirec standard i/o of child process to standard i/o of node.js process
let cp = spawn('wget', 'some_file_url')
cp.stdin.pipe(process.stdin)
cp.stdout.pipe(process.stdout)
cp.stderr.pipe(process.stderr)
now i execute code above in node.js, everything is ok but progress bar. it just looks like this:
0K .......... .......... .......... .......... .......... 0% 134K 5m21s
50K .......... .......... .......... .......... .......... 0% 631K 3m14s
100K .......... .......... .......... .......... .......... 0% 4.64M 2m12s
150K .......... .......... .......... .......... .......... 0% 167M 99s
normally, if i execute wget command on terminal
$ wget some_file_url
a dynamic progress bar will display in output
file.tar.gz 15%[======> ] 6.69M 2.27MB/s
so, how should i do to make the progress bar display like above
environments
- node.js: v14.16.1
- wget: GNU Wget 1.21.2 built on darwin21.1.0
sorry
my english is poor. please excuse grammar or typing error. i'm trying my best to imporve.