async function listFiles(auth) {
  const service = google.drive('v3');
  service.files.list({
    auth,
    pageSize: 10,
    fields: 'nextPageToken, files(id, name)',
    q: 'mimeType = \'application/vnd.google-apps.folder\' and name contains \'Joshua-server-photos\'',
  },
  (err, res) => {
    if (err) {
      console.error('The API returned an error.');
      throw err;
    }
    const {
      files,
    } = res.data;
    if (files.length === 0) {
      console.log('No files found.');
    } else {
      console.log('Files:');
      files.map(file => console.log(`${file.name} (${file.id})`));
    }
  });
}
/**
 * Lists the names and IDs of up to 10 files.
 * @param {google.auth.OAuth2} auth An authorized OAuth2 client.
 */
Lists the names and IDs of up to 10 files.
@param {google.auth.OAuth2} auth An authorized OAuth2 client.
Lists the names and IDs of up to 10 files . @param { google . auth . OAuth2 } auth An authorized OAuth2 client .
async function listFiles(auth) {
  const service = google.drive('v3');
  service.files.list({
    auth,
    pageSize: 10,
    fields: 'nextPageToken, files(id, name)',
    q: 'mimeType = \'application/vnd.google-apps.folder\' and name contains \'Joshua-server-photos\'',
  },
  (err, res) => {
    if (err) {
      console.error('The API returned an error.');
      throw err;
    }
    const {
      files,
    } = res.data;
    if (files.length === 0) {
      console.log('No files found.');
    } else {
      console.log('Files:');
      files.map(file => console.log(`${file.name} (${file.id})`));
    }
  });
}
async function listFiles ( auth ) { const service = google . drive ( 'v3' ) ; service . files . list ( { auth , pageSize : 10 , fields : 'nextPageToken, files(id, name)' , q : 'mimeType = \'application/vnd.google-apps.folder\' and name contains \'Joshua-server-photos\'' , } , ( err , res ) => { if ( err ) { console . error ( 'The API returned an error.' ) ; throw err ; } const { files , } = res . data ; if ( files . length === 0 ) { console . log ( 'No files found.' ) ; } else { console . log ( 'Files:' ) ; files . map ( file => console . log ( ` ${ file . name } ${ file . id } ` ) ) ; } } ) ; }
Lists the names and IDs of up to 10 files.
Lists the names and IDs of up to 10 files .