ensureDir

Ensures the directory exists, creating it recursively if not

A utility for node, ensures the directory exists, creating it recursively if not.

ensureDir('./temp/path/to/nonexist/dir/', 0755, function (err) {
    if (err) return next(err);
    // your code here!
});
$ npm install ensureDir