pksunkara/pygments.js — pull request #3 by qiao (2012-01-26 04:50:38+00:00)
Title: fix incomplete result for large data

In your original code, the callback is called as soon as the `data` event is emitted.

pyg.stdout.on('data', function(data) {
callback(data.toString());
});

This works only when the size output is small. For large output, the `data` event will be emitted multiple times and each time there's a partial chunk arriving. Therefore, your original approach will produce incomplete result.