How about using nodes native fs
module http://nodejs.org/api/fs.html#fs_fs_readdir_path_callback. It's readdir
and readdirSync
functions provide you with an array of all the included file names (excluding .
and ..
). If the length is 0
then your directory is empty.