lib/config/buddyPlugins.js
function loadPluginsFromDir(dir, config) {
  try {
    fs
      .readdirSync(dir)
      .filter(resource => {
        if (path.basename(dir) != 'plugins') return RE_PLUGIN.test(resource);
        return RE_JS_FILE.test(resource) || fs.statSync(path.join(dir, resource)).isDirectory();
      })
      .forEach(resource => {
        registerPlugin(path.join(dir, resource), config);
      });
  } catch (err) {
    /* ignore */
  }
}
function loadPluginsFromDir(dir, config) {
  try {
    fs
      .readdirSync(dir)
      .filter(resource => {
        if (path.basename(dir) != 'plugins') return RE_PLUGIN.test(resource);
        return RE_JS_FILE.test(resource) || fs.statSync(path.join(dir, resource)).isDirectory();
      })
      .forEach(resource => {
        registerPlugin(path.join(dir, resource), config);
      });
  } catch (err) {
    /* ignore */
  }
}
function loadPluginsFromDir ( dir , config ) { try { fs . readdirSync ( dir ) . filter ( resource => { if ( path . basename ( dir ) != 'plugins' ) return RE_PLUGIN . test ( resource ) ; return RE_JS_FILE . test ( resource ) || fs . statSync ( path . join ( dir , resource ) ) . isDirectory ( ) ; } ) . forEach ( resource => { registerPlugin ( path . join ( dir , resource ) , config ) ; } ) ; } catch ( err ) { /* ignore */ } }
Load plugins in 'dir'
@param {String} dir
@param {Object} config
Load plugins in dir