sindresorhus / pify

Promisify a callback-style function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not getting full parameters of callbacks

hbakhtiyor opened this issue · comments

e.g.

const dns = require('dns');
const pify = require('pify');

const dnsLookup = pify(dns.lookup);

(async () => {
    const result = await dnsLookup('example.com');
    console.log(result); // => 93.184.216.34
})()

only getting ip address, from the doc, the callback is passing family param too

need return object, e.g.

  const {address, family} = await dnsLookup('example.com');