bitpay/node-bitpay-client — pull request #56 by gordonwritescode (2014-10-14 15:46:36+00:00)
Title: FEATURE: Invoice Events

This PR includes a new a constructor for `EventParser` which is a `stream.Transform`. Since all of the `RESTClient` "verb" methods (`get()`, `put()`, `post()`, and `delete()`) return a `stream.Readable`, this constructor can be used to pipe calls to `/events` through and use `EventEmitter` style handling.

```js
var events = client.get('events', buspass).pipe(new bitpay.EventParser());

events.on('payment', function(invoice) {
console.log('Invoice Status: ' + invoice.status);
});
```

This should effecctively close #55

See the included example and tests for more details. Also addresses Pieter's requested doc updates.

@pnagurny or @martindale - either of you have time today to review, test, and merge? Package version has been bumped and ready to publish to NPM.