a) the filter should go before the cb, not after. In node, the cb is
always the last arg.
b) the function shouldn't be called "readdir". The methods on the fs
module map directly to their "man 3" counterparts, so this function
maps pretty directly to the semantics of readdir(3).
--i
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>
The more I think about this, I really think this belongs outside of
node core. There are a lot of edge cases to consider.
npm install glob
require("glob").glob("*.txt", function (er, files) { ... })
or:
files = require("glob").globSync("*.txt")