I am quite new in using JS, so I will try to be as specific as I can :)
I have a folder with 260 .png files with different country names: Afghanistan.
Afghanistan.
Go through http://nodejs.org/api/fs.html
http://nodejs.org/api/fs.html
One important thing - you can use sync functions also. (It will work like C program)