Counting depth in dir using JavaScript and Node.js