Lookup nsqd nodes via N nsqlookupd addresses.
$ npm install nsq-lookup
var lookup = require('nsq-lookup');
var addrs = [
'http://0.0.0.0:4161',
'http://0.0.0.0:4162',
'http://0.0.0.0:4161',
];
var opts = {
timeout: 10000,
topic: 'foobar' // optionally filter nodes based on topic
};
lookup(addrs, opts, function(errors, nodes){
if (errors) {
console.error(errors)
} else {
console.log(nodes);
}
});
MIT