You should ensure the stream is processed by lines, otherwise all the regex can break.
I faced a behavior where data event received chunks composed of multiple lines at once.
It happened when i started to send quiet some data.
With small amount of exchanged data, I have not noticed that behavior.
fore reference,
I did that
var byline = require('byline');
byline(cp.stderr).on('data', function (data) {
data = data.trim();
...
Hi,
In here https://github.com/kevva/screenshot-stream/blob/master/index.js#L63
You should ensure the stream is processed by lines, otherwise all the regex can break.
I faced a behavior where data event received chunks composed of multiple lines at once. It happened when i started to send quiet some data. With small amount of exchanged data, I have not noticed that behavior.
fore reference, I did that
I rely on https://github.com/jahewson/node-byline