Otherwise, this will result in debugging the child on a free port:
// Determine if in debug mode. // If so, pass in a debug-brk option manually, without specifying port. var startOpts = {}; var isInDebugMode = typeof v8debug === 'object'; if(isInDebugMode) { startOpts = {execArgv: ['--debug-brk']}; } child_process.fork('./some_module.js', startArgs, startOpts);
Roman
source share