fetching 'rsync' output with nodejs child_process.exec callback

Currently I'm failing to fetch the rsync output when I'm calling nodejs child_process.exec with a callback-function like in this snippet:

var sys = require('sys'),
exec = require('child_process').exec;

cmd = 'rsync -rpz test/test-files/one.txt jloos@test.mygnia.de:~/remote-test/a/b/'
exec(cmd, function(error, stdio, stderr) { 
  sys.print('s: ' + stdio + '\n');
  sys.print('e: ' + stderr + '\n'); 
});

I think this is caused by the specific behavior of rsync. rsync communicates with it's counterpart via terminal. So how can I fetch the messages from rsync, if even possible?

When I use cmd = 'ls -la' I get the expected output.

Thanks

Often stdout is buffered when the program isn't running in a virtual terminal. Many languages have a pty module which will trick the program into behaving as though it is running in a terminal.

This provides that functionality for NodeJs; https://github.com/chjj/pty.js

Keep in mind that rsync may be writing lots of special characters or using something like ncurses to provide the updating status messages, which may make it more difficult to work with the output.