How to read the folder with all sub folders and file inside folder with capacitor Filesystem?


I was trying to read the directory with all subdirectories from FilesystemDirectory.Data. When I was trying to use readDir it was just giving some result as shown below. Please someone can help me how I can read the directory along with subdirectories and files inside the subdirectories.


const results = await Filesystem.readdir({
        path: `testDir`,
        directory: FilesystemDirectory.Data


{files: ["hello"]}

Here, I was just getting the list of directory names in array.