tasks/generate-info.js
function spawnJSDoc(paths) {
  return new Promise((resolve, reject) => {
    let output = '';
    let errors = '';
    const cwd = path.join(__dirname, '..');
    const child = spawn(jsdoc, ['-c', jsdocConfig].concat(paths), {cwd: cwd});

    child.stdout.on('data', data => {
      output += String(data);
    });

    child.stderr.on('data', data => {
      errors += String(data);
    });

    child.on('exit', code => {
      if (code) {
        reject(new Error(errors || 'JSDoc failed with no output'));
        return;
      }

      let info;
      try {
        info = parseOutput(output);
      } catch (err) {
        reject(err);
        return;
      }
      resolve(info);
    });
  });
}
function spawnJSDoc(paths) {
  return new Promise((resolve, reject) => {
    let output = '';
    let errors = '';
    const cwd = path.join(__dirname, '..');
    const child = spawn(jsdoc, ['-c', jsdocConfig].concat(paths), {cwd: cwd});

    child.stdout.on('data', data => {
      output += String(data);
    });

    child.stderr.on('data', data => {
      errors += String(data);
    });

    child.on('exit', code => {
      if (code) {
        reject(new Error(errors || 'JSDoc failed with no output'));
        return;
      }

      let info;
      try {
        info = parseOutput(output);
      } catch (err) {
        reject(err);
        return;
      }
      resolve(info);
    });
  });
}
function spawnJSDoc ( paths ) { return new Promise ( ( resolve , reject ) => { let output = '' ; let errors = '' ; const cwd = path . join ( __dirname , '..' ) ; const child = spawn ( jsdoc , [ '-c' , jsdocConfig ] . concat ( paths ) , { cwd : cwd } ) ; child . stdout . on ( 'data' , data => { output += String ( data ) ; } ) ; child . stderr . on ( 'data' , data => { errors += String ( data ) ; } ) ; child . on ( 'exit' , code => { if ( code ) { reject ( new Error ( errors || 'JSDoc failed with no output' ) ) ; return ; } let info ; try { info = parseOutput ( output ) ; } catch ( err ) { reject ( err ) ; return ; } resolve ( info ) ; } ) ; } ) ; }
Spawn JSDoc.
@param {Array<string>} paths Paths to source files.
@return {Promise<string>} Resolves with the JSDoc output (new metadata).
If provided with an empty list of paths, resolves with null.
Spawn JSDoc .