lib/master.js
function isWorkerCmd(cmd) {
	cmd = cmd.concat(); // make a local copy of the array

	// a worker has the same command line as the current process!
	if (cmd.shift() !== process.execPath) return false; // execPath was used when spawning children

	// workers *may* have more params, we care if all master params exist in the worker cli
	for (var idx = 0; idx < master_args.length; idx++) {
		if (cmd[idx] !== master_args[idx]) return false;
	}

	return true;
}
function isWorkerCmd(cmd) {
	cmd = cmd.concat(); // make a local copy of the array

	// a worker has the same command line as the current process!
	if (cmd.shift() !== process.execPath) return false; // execPath was used when spawning children

	// workers *may* have more params, we care if all master params exist in the worker cli
	for (var idx = 0; idx < master_args.length; idx++) {
		if (cmd[idx] !== master_args[idx]) return false;
	}

	return true;
}
function isWorkerCmd ( cmd ) { cmd = cmd . concat ( ) ; // make a local copy of the array // a worker has the same command line as the current process! if ( cmd . shift ( ) !== process . execPath ) return false ; // execPath was used when spawning children // workers *may* have more params, we care if all master params exist in the worker cli for ( var idx = 0 ; idx < master_args . length ; idx ++ ) { if ( cmd [ idx ] !== master_args [ idx ] ) return false ; } return true ; }
computed once now
computed once now