code: function runBin(path, args = [], env = process.env) {
    return new Promise((resolve, reject) => {
      /** @type {string[]} */
      const stdout = [];
      /** @type {string[]} */
      const stderr = [];
  
      const child = spawn(path, args, { env });
  
      child.on('error', (error) => {
        reject(error);
      });
  
      child.stdout.on('data', (data) => {
        stdout.push(data.toString());
      });
  
      child.stderr.on('data', (data) => {
        stderr.push(data.toString());
      });
  
      child.on('close', (code) => {
        if (stderr.length || code !== 0) {
          reject(stderr);
        } else {
          resolve(stdout);
        }
      });
    });
  }
docs: Run a binary file in a separate process and get stdout/stderr.
  @param {string} path The full path to the binary file.
  @param {(string[])=} args Arguments to pass to the called script.
  @param {NodeJS.ProcessEnv} env Override `process.env` with custom parameters.
  @returns {Promise.<string[]>} Returns a promise with an array of the stdout
  or stderr messages.