Looping through a folder in javascript

I’m making an art gallery for my website, and to load the images i need to loop through all of them. I’ve tried fs but i’ve been told that node modules like fs don’t work in browsers. Is there another way of looping through a folder and getting the directory of the image in a browser?