I\'ve been searching how to do it in other languages and I\'ve found that I have to use the special character \\b to remove the last character. (how-do-i-erase-printed-chara
The easiest way to overwrite the same line is
var dots = ... process.stdout.write('Progress: '+dots+'\r');
the \r is the key. It will move the cursor back to the beginning of the line.
\r