{"size": 585, "ext": "js", "max_stars_repo_path": "server/config/util.js", "max_stars_repo_name": "Localism/clique_1", "max_stars_repo_stars_event_min_datetime": "2015-11-06T01:16:48.000Z", "max_stars_repo_stars_event_max_datetime": "2016-12-17T16:49:44.000Z", "max_issues_repo_path": "server/config/util.js", "max_issues_repo_name": "Localism/clique_1", "max_issues_repo_issues_event_min_datetime": "2015-02-07T19:23:18.000Z", "max_issues_repo_issues_event_max_datetime": "2015-02-07T19:26:21.000Z", "max_forks_repo_path": "server/config/util.js", "max_forks_repo_name": "Localism/clique_1", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 30.7894736842, "max_line_length": 63, "alphanum_fraction": 0.6017094017}
'use strict';

var fs = require('fs'),
    path = require('path');

// recursively walk modules path and callback for each file
var walk = function(modulesPath, excludeDir, callback) {
    fs.readdirSync(modulesPath).forEach(function(file) {
        var newPath = path.join(modulesPath, file);
        var stat = fs.statSync(newPath);
        if (stat.isFile() && /(.*)\.(js|coffee)$/.test(file)) {
            callback(newPath);
        } else if (stat.isDirectory() && file !== excludeDir) {
            walk(newPath, excludeDir, callback);
        }
    });
};
exports.walk = walk;
