MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / checkAsyncHooks

Function checkAsyncHooks

test/async_worker.js:9–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7const nodeVersion = process.versions.node.split('.')[0];
8let asyncHooks;
9function checkAsyncHooks () {
10 if (nodeVersion >= 8) {
11 if (asyncHooks === undefined) {
12 asyncHooks = require('async_hooks');
13 }
14 return true;
15 }
16 return false;
17}
18
19module.exports = common.runTest(test);
20

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56