MCPcopy Index your code
hub / github.com/nodejs/node / query

Function query

test/fixtures/snapshot/dns-lookup.js:20–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20function query() {
21 const host = process.env.NODE_TEST_HOST;
22 if (process.env.NODE_TEST_PROMISE === 'true') {
23 dns.promises.lookup(host, { family: 4 }).then(
24 ({address, family}) => onLookup(address, family),
25 onError);
26 } else {
27 dns.lookup(host, { family: 4 }, (err, address, family) => {
28 if (err) {
29 onError(err);
30 } else {
31 onLookup(address, family);
32 }
33 });
34 }
35}
36
37query();
38

Callers 1

dns-lookup.jsFile · 0.70

Calls 4

onLookupFunction · 0.85
onErrorFunction · 0.70
thenMethod · 0.45
lookupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…