All the code for this function already exists, but only ChildProcess.exec was allowed to use the code.