tester.js
406 Bytes
'usu strict';
const zookeeper = require('node-zookeeper-client');
module.exports = (server) => new Promise((resolve, reject) => {
const client = zookeeper.createClient(server);
var timer = setTimeout(() => {
resolve(false);
}, 1000);
client.once('connected', () => {
clearTimeout(timer);
resolve(true);
client.close();
});
client.connect();
});