HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ubuntu-s-2vcpu-4gb-nyc3-01 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64
User: www-data (33)
PHP: 8.3.7
Disabled: NONE
Upload Files
File: //usr/share/node_modules/node-preload/hook-spawn.js
'use strict';

const path = require('path');

const processOnSpawn = require('process-on-spawn');
const {needsPathEnv, processNodePath} = require('./generate-require.js');
const processNodeOptions = require('./process-node-options.js');
const preloadList = require('./preload-list.js');
const preloadListEnv = require('./preload-list-env.js');

processOnSpawn.addListener(({env}) => {
	env.NODE_OPTIONS = processNodeOptions(
		env.NODE_OPTIONS || /* istanbul ignore next: impossible under nyc 15 */ ''
	);
	/* istanbul ignore next */
	if (needsPathEnv(__dirname)) {
		env.NODE_PATH = processNodePath(env.NODE_PATH || '');
	}

	env[preloadListEnv] = preloadList.join(path.delimiter);
});