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

Function checkAsyncHooks

test/callbackscope.js:8–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56