stianeikeland / node-etcd

:satellite: Etcd client for nodejs
BSD 3-Clause "New" or "Revised" License
259 stars 85 forks source link

Any plan to support Promise? #83

Open Gerhut opened 6 years ago

analytik commented 5 years ago

Easy solution:

const bluebird = require('bluebird');
const Etcd = require('node-etcd');
bluebird.promisifyAll(Etcd.prototype);
const etcd = new Etcd('http://127.0.0.1:2379');
async function foo() {
  let resp = await etcd.getAsync('/foo/bar/');
  console.log('results are here:', resp.node.nodes);
}
foo();