Look at the sauce for fs.exists. I think you'll find it enlightening. (tl;dr: use fs.stat instead.)
--Josh On Fri, Aug 17, 2012 at 3:57 PM, Alexey Petrushin <alexey.petrus...@gmail.com> wrote: > Wondering why `fs.exists` doesn't comply to async methods pattern and > doesn't return error as a first argument? > > It uses > > fs.exists('/etc/passwd', function (exists) { > util.debug(exists ? "it's there" : "no passwd!"); > }); > > > Instead of > > fs.exists('/etc/passwd', function (err, exists) { > util.debug(exists ? "it's there" : "no passwd!"); > }); > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Joshua Holbrook Head of Support Nodejitsu Inc. j...@nodejitsu.com -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en