lib/installer.js
function dirInstall(dirpath, callback) {
  callback = utils.defineCallback(callback);
  return fs.exists(dirpath, function(exists) {
    if (!exists) {
      return callback(new errors.DirectoryNotExistingError());
    }
    var pluginName = path.basename(dirpath);
    var destPath = path.join(pluginsDir, pluginName);
    return ncp(dirpath, destPath, function(copyError) {
      if (copyError) {
        return callback(new errors.PluginsMoveFromTempError(copyError));
      }
      return callback(null);
    });
  });
}
function dirInstall(dirpath, callback) {
  callback = utils.defineCallback(callback);
  return fs.exists(dirpath, function(exists) {
    if (!exists) {
      return callback(new errors.DirectoryNotExistingError());
    }
    var pluginName = path.basename(dirpath);
    var destPath = path.join(pluginsDir, pluginName);
    return ncp(dirpath, destPath, function(copyError) {
      if (copyError) {
        return callback(new errors.PluginsMoveFromTempError(copyError));
      }
      return callback(null);
    });
  });
}
function dirInstall ( dirpath , callback ) { callback = utils . defineCallback ( callback ) ; return fs . exists ( dirpath , function ( exists ) { if ( ! exists ) { return callback ( new errors . DirectoryNotExistingError ( ) ) ; } var pluginName = path . basename ( dirpath ) ; var destPath = path . join ( pluginsDir , pluginName ) ; return ncp ( dirpath , destPath , function ( copyError ) { if ( copyError ) { return callback ( new errors . PluginsMoveFromTempError ( copyError ) ) ; } return callback ( null ) ; } ) ; } ) ; }
Install plugins from Directory

@param  {String} dirpath - path to directory
@param  {Function} [callback]
Install plugins from Directory