2.2.4 • Published 7 years ago

js-diplomat v2.2.4

Weekly downloads
14
License
ISC
Repository
github
Last release
7 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

7 years ago

2.2.3

7 years ago

2.2.2

8 years ago

2.2.0

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago