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

Latest commit

 

History

History
39 lines (28 loc) · 505 Bytes

Readme.md

File metadata and controls

39 lines (28 loc) · 505 Bytes

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