2.2.4 • Published 8 years ago

js-diplomat v2.2.4

Weekly downloads
14
License
ISC
Repository
github
Last release
8 years ago

JavaScript version diplomat

Build status

A package provide easy api to find service in consul, support auto refresh service info.

Install

npm install js-diplomat

Methods

discover

Initialize a new discovery client.

  • url {String}: consul host info
Usage
const discover = require('js-diplomat')('consul://localhost:8500')

service

Find a service info by service name.

  • name {Strng}: service name
  • options {Object}:
    • dc {String}: datacenter
    • tag {String}: service tags
    • passing {Boolean}: restrict to passing checks
    • stragety {String}: How to return service info, can be 'random'
Usage
discover.service('owl').then(function (node) {
  console.log(node.address);
  console.log(node.port);
});
2.2.4

8 years ago

2.2.3

8 years ago

2.2.2

9 years ago

2.2.0

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago