Here's the code I use to browse a directory :
var path = 'D:/Syslog/live';
listDir(path);
function listDir (path) {
    fs.readdir(path, function(err, files)
    {
        console.log(files);
        for( i = 0; i < files.length; i++)
        {
            var fullPath = path + "/" + files[i];
            fs.stat(fullPath, function(err, stats){
               if (stats.isDirectory())
               {
                   listDir(fullPath);
               } else
               {
                   console.log(files[i]);
               }
               });
        }
    });
}
When I debug and use the variable fullPath it works fine, if I use files[i] (which is declared in the level, i is undefined
 
     
    