75lb/handbrake-js — pull request #2 by Dudemullet (2014-02-12 08:57:33+00:00)
Title: Handle incomplete 'data' event from stdout event

Noticed during testing in Windows 7 that the `stdout.data` Event would not always pass a complete line of `processing` data but instead an incomplete line of data, causing an exception.

#### Expecting:
`Encoding: task of ...etc`

#### Occasionally (Windows 7)
`Encoding: task`

This would pass the initial test [handbrake.js:70](https://github.com/75lb/handbrake-js/blob/be78de8b4ec7a6f5dcb8850ade6fdd4fe9c09a12/lib/handbrake.js#L67) but would throw an exception when trying to access `match[1]`.

With this PR I propose that we instead always expect an incomplete line and use a buffer. Test this buffer with `/rEncoding:/r` and after useage, pop that line from the buffer.