I have the following structure
--- Folder
- Sub-folder
-1a.json
-1b.json
- Sub-folder
-2a.json
- Sub-folder
- more JSONS here
- something.ts
I want to write a function that takes "Folder" and recursively iterate over all of it, ignoring anything that is not .json in the end (like something.ts) and return an array of all my jsons. I would later parse these jsons and create a class I wrote from them.
How can I recursively fetch all jsons and ignore other files like that? Tried using FS but I can't figure out how to fetch everything according to my demands