Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Geremy Cohen committed Mar 26, 2014
1 parent 6354f4e commit d234060
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions node.js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ var pubnub = require("pubnub").init({
subscribe_key : "demo"
});

/* ---------------------------------------------------------------------------
Publish Messages
--------------------------------------------------------------------------- */
var message = { "some" : "data" };
pubnub.publish({
channel : 'my_channel',
message : message,
callback : function(e) { console.log( "SUCCESS!", e ); },
error : function(e) { console.log( "FAILED! RETRY PUBLISH!", e ); }
});

/* ---------------------------------------------------------------------------
Listen for Messages
--------------------------------------------------------------------------- */
Expand All @@ -43,4 +54,6 @@ stdin.on( 'data', function(chunk) {
message : ''+chunk
});
});


```

0 comments on commit d234060

Please sign in to comment.