Skip to content

Commit

Permalink
Add msgpack.Stream documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgriess committed May 27, 2010
1 parent 976b512 commit c189d23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -36,6 +36,18 @@ the resulting object at the end using `assert.deepEqual()`.

assert.deepEqual(oo, o);

As a convenience, a higher level streaming API is provided in the
`msgpack.Stream` class, which can be constructed around a `net.Stream`
instance. This object emits `msg` events when an object has been received.

var msgpack = require('msgpack');

// ... get a net.Stream instance, s, from somewhere
var ms = new msgpack.Stream(s);
ms.addListener('msg', function(m) {
sys.debug('received message: ' + sys.inspect(m));
});

### Command Line Utilities

As a convenience and for debugging, `bin/json2msgpack` and `bin/msgpack2json`
Expand Down

0 comments on commit c189d23

Please sign in to comment.