phillro/node-elasticsearch-client — pull request #53 by juzerali (2013-02-15 20:54:21+00:00)
Title: Canonical2: Canonical callbacks with backward compatibility

So this branch supports canonical callbacks with complete backward compatibility.

* Tests for event (`.on('data')`) api is in `tests/evented` folder
* String from ES server is passed in event callback as is
* In canonical callbacks, json objects are passed, if parsing fails an error object is passed as the first argument along with the string received from ES server as is as a second argument. [Here](https://github.com/phillro/node-elasticsearch-client/blob/canonical2/lib/elasticsearchclient/calls/elasticSearchCall.js#L53-L59) is the specific piece of code.