0

I have a directory containing a bunch of folders, all having an html,css and js file inside. I need some way to get like an array of all of these folder in order to access their data and using it in another html file using javascript. ex: this is my directory:

  currentDirectory>
         folder1>
               htmlFile
               cssFile
               jsFile
         folder2>
               htmlFile
               cssFile
               jsFile
         folder3>
               htmlFile
               cssFile
               jsFile
         etc...

I would need to fill up something like this:

let foldersInCurrentDirectory = [
                  {
                      RelativePath: '',
                      htmlFileName: '',
                      cssFileName : '',
                      jsFileName  : '',
                      
                   },
                   {
                      RelativePath: '',
                      htmlFileName: '',
                      cssFileName : '',
                      jsFileName  : '',
                      
                   },
                   {
                     //and so on.....
                   }
              ];
3
  • Just manual type the name in. You can't do it with plain JS. Maybe node.js would be a better option. Commented Jun 21, 2021 at 22:54
  • @TobyHarnish is there a way to like get the data with node and send it to a plain js file? Commented Jun 21, 2021 at 23:03
  • stackoverflow.com/questions/5827612/… Commented Jun 21, 2021 at 23:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.