node-etcd icon indicating copy to clipboard operation
node-etcd copied to clipboard

Any plan to support Promise?

Open Gerhut opened this issue 7 years ago • 1 comments

Gerhut avatar Jun 22 '18 05:06 Gerhut

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();

analytik avatar Oct 18 '18 11:10 analytik