fshost / node-dir

Recursive asynchronous file and directory operations for Node.js
MIT License
221 stars 44 forks source link

statSync? #26

Closed drudge closed 8 years ago

drudge commented 8 years ago

Hello,

Is there a reason that you are using statSync on line 66 of paths.js? https://github.com/fshost/node-dir/blob/master/lib/paths.js#L66

Everything else seems to be async, but this is sync and doesn't have error handling so it can result in a crash like this:

Error: ENOENT: no such file or directory, stat '/Users/drudge/XXXXXX'
    at Error (native)
    at Object.fs.statSync (fs.js:892:18)
    at Object.files (/Users/drudge/XXXX/node_modules/node-dir/lib/paths.js:66:12)
drudge commented 8 years ago

Fixed in #27