lib/service.js
function(dir) {
  var methods = [];

  var findConfigFiles = function(dir) {
    fs.readdirSync(dir).forEach(function(file) {
      file = path.join(dir, file);
      var stat = fs.statSync(file);
      if(stat && stat.isDirectory()) {
        findConfigFiles(file);
      } else if(/config.js$/.test(file)) {
        methods.push(file);
      }
    });
  };

  findConfigFiles(dir);

  return methods;
}
function(dir) {
  var methods = [];

  var findConfigFiles = function(dir) {
    fs.readdirSync(dir).forEach(function(file) {
      file = path.join(dir, file);
      var stat = fs.statSync(file);
      if(stat && stat.isDirectory()) {
        findConfigFiles(file);
      } else if(/config.js$/.test(file)) {
        methods.push(file);
      }
    });
  };

  findConfigFiles(dir);

  return methods;
}
function ( dir ) { var methods = [ ] ; var findConfigFiles = function ( dir ) { fs . readdirSync ( dir ) . forEach ( function ( file ) { file = path . join ( dir , file ) ; var stat = fs . statSync ( file ) ; if ( stat && stat . isDirectory ( ) ) { findConfigFiles ( file ) ; } else if ( / config.js$ / . test ( file ) ) { methods . push ( file ) ; } } ) ; } ; findConfigFiles ( dir ) ; return methods ; }
Recurse through the passed method dir,
finding method config.
@param  {String} dir methods root directory
@return {Array}     paths to method config files
Recurse through the passed method dir finding method config .