Swarmerode is a tool to extend dockerode
with nice swarm helper functions.
var Swarmerode = require('swarmerode')
var Dockerode = require('dockerode')
// extend Dockerode w/ Swarm functions.
Dockerode = Swarmerode(Dockerode)
var swarmClient = new Dockerode(/* opts */)
swarmClient.swarmHostExists('10.0.0.1:2375', function (err, hostExists) {
if (err) { throw err }
console.log(
hostExists
? 'The given host exists!'
: 'The given host was not found.'
)
})