lib/base.js
function mkdir(dest, cb) {
  var dir = path.dirname(path.resolve(dest));
  utils.mkdirp(dir, function(err) {
    if (err && err.code !== 'EEXIST') {
      err.message = formatError('mkdirp cannot create directory', dir, err);
      return cb(new Error(err));
    }
    cb();
  });
}
function mkdir(dest, cb) {
  var dir = path.dirname(path.resolve(dest));
  utils.mkdirp(dir, function(err) {
    if (err && err.code !== 'EEXIST') {
      err.message = formatError('mkdirp cannot create directory', dir, err);
      return cb(new Error(err));
    }
    cb();
  });
}
function mkdir ( dest , cb ) { var dir = path . dirname ( path . resolve ( dest ) ) ; utils . mkdirp ( dir , function ( err ) { if ( err && err . code !== 'EEXIST' ) { err . message = formatError ( 'mkdirp cannot create directory' , dir , err ) ; return cb ( new Error ( err ) ) ; } cb ( ) ; } ) ; }
Ensure that a directory exists before trying to write to it.

@param {String} `dest`
@param {Function} `cb` Callback function
Ensure that a directory exists before trying to write to it .