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

Function initializeDefaultConditions

lib/internal/modules/esm/utils.js:76–89  ·  view source on GitHub ↗

* Initializes the default conditions for ESM module loading. * This function is called during pre-execution, before any user code is run. * @returns {void}

()

Source from the content-addressed store, hash-verified

74 * @returns {void}
75 */
76function initializeDefaultConditions() {
77 const userConditions = getOptionValue('--conditions');
78 const noAddons = getOptionValue('--no-addons');
79 const addonConditions = noAddons ? [] : ['node-addons'];
80 const moduleConditions = getOptionValue('--require-module') ? ['module-sync'] : [];
81 defaultConditions = ObjectFreeze([
82 'node',
83 'import',
84 ...moduleConditions,
85 ...addonConditions,
86 ...userConditions,
87 ]);
88 defaultConditionsSet = new SafeSet(defaultConditions);
89}
90
91/**
92 * @param {string[]} [conditions]

Callers 1

initializeESMFunction · 0.85

Calls 1

getOptionValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…