ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

readdirRecursive example in readme has mistake #21

Closed themightychris closed 12 years ago

themightychris commented 12 years ago

should be if(curFiles) instead of if(files), no?

ryanmcgrath commented 12 years ago

Mmmm, simplified this example, as... well, it was needlessly branching. If people want to handle that kind of scenario, it's trivial and they will.

themightychris commented 12 years ago

It was definitely helpful though for the example to show that curFiles would be null when you reached the end of the listings.

I really like dive's syntax for this operation: https://github.com/pvorb/node-dive

It takes a second callback to be executed when the recursion has completed