HEX
Server: Apache
System: Linux ubuntu-s-2vcpu-4gb-amd-sfo3-01-KIT-DIGITAL 6.5.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 7 15:10:09 UTC 2024 x86_64
User: www-data (33)
PHP: 8.2.10-2ubuntu2.2
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);
});