I already have read the documentation of Node.js and, unless if I missed something, it does not tell what the parameters contain in certain operations, in particular fs.mkdi
You'd better not to count the filesystem hits while you code in Javascript, in my opinion.
However, (1) stat & mkdir and (2) mkdir and check(or discard) the error code, both ways are right ways to do what you want.