Is there a method for printing to the console without a trailing newline? The console object documentation doesn\'t say anything regarding that:
util.print can be used also. Read: http://nodejs.org/api/util.html#util_util_print
util.print([...])# A synchronous output function. Will block the process, cast each argument to a string then output to stdout. Does not place newlines after each argument.
An example:
// get total length
var len = parseInt(response.headers['content-length'], 10);
var cur = 0;
// handle the response
response.on('data', function(chunk) {
cur += chunk.length;
util.print("Downloading " + (100.0 * cur / len).toFixed(2) + "% " + cur + " bytes\r");
});