I have couple of images in images/source
directory which is at root level. I want to read all the images in the folder and get its path to something like below:
var images = ['images/source/first.jpg', 'images/source/second.png', 'images/source/third.png'];
I am trying to read the directory something like below, but its not working!
const imgPath= fs.readdirSync(path.join(__dirname, '/images/source')).sort();
The above code reads all the images, but i need all the images with their path in an array.