I am looking for a way to empty a directory in Express.
Basically, I have a tmp directory where I am storing temporary files and every so often I just want to empty the folder of all files, but not delete the folder itself.
What is the best way to do this? I am currently using Node v0.8.9 and Express v.3.0.0rc4.
Either check this little but sweet module.
https://github.com/isaacs/rimraf
Or check the official docs and examples.
http://nodejs.org/docs/v0.4.1/api/fs.html#file_System