stringListener = channel => chunk => {
    const data = chunk.toString();
    output[channel] += data;
    const match = chunk.toString().match(pattern);
    patternMatch = patternMatch || (match && match[0]);
    if (match) resolve();
  }
@param {'stdout'|'stderr'} channel @return {(chunk: Buffer) => void}