Skip to content

Instantly share code, notes, and snippets.

@aricart
Created August 17, 2017 21:11
Show Gist options
  • Save aricart/4c0dab586abf77eddcf6ed490e746c59 to your computer and use it in GitHub Desktop.
Save aricart/4c0dab586abf77eddcf6ed490e746c59 to your computer and use it in GitHub Desktop.
var nc = require('nats').connect();
nc.on('error', function(err) {
console.log(err);
});
nc.subscribe(">", function(msg, reply, subject, subID) {
console.log("msg: [" + msg + "] reply: [" + reply + "] subject: [" + subject + "] subID: [" + subID + "]");
});
nc.flush();
nc.publish("hello world");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment