Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

segmentio/nsq-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nsq-lookup

Lookup nsqd nodes via N nsqlookupd addresses.

Installation

$ npm install nsq-lookup

Example

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);
  }
});

License

MIT