I am trying to print all folder names from the parent folder in google drive
I tried so many methods but not working..
const drive = google.drive({ version: 'v3', auth });
console.log("Drive => ", drive.drives.appdata);
drive.files.list({
//spaces: 'drive',
//isRoot: true,
//pageSize: 10,
}, (err, res) => {
console.log(err);
if (err) return console.log('The API returned an error: ' + err);
const files = res.data.files;
if (files.length) {
console.log('Files:');
files.map((file) => {
console.log(file);
});
} else {
console.log('No files found.');
}
});
Above code only giving the file name of those folder but I am trying to print all parent folder names.?
I need to print angular_files, datastructurealgo,DSA,Tools
names. These all are folders.