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

Function checkAsyncHooks

test/async_context.js:10–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56