diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 5b5199c262ae3b..cda94987fad210 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -9,6 +9,8 @@ const { CHAR_HASH, } = require('internal/constants'); +const { getOptions } = internalBinding('options'); + // Invoke with makeRequireFunction(module) where |module| is the Module object // to use as the context for the require() function. function makeRequireFunction(mod) { @@ -105,7 +107,7 @@ const builtinLibs = [ 'v8', 'vm', 'zlib' ]; -if (process.binding('config').experimentalWorker) { +if (getOptions('--experimental-worker')) { builtinLibs.push('worker_threads'); builtinLibs.sort(); }