<commit_before>const fs = require('fs')
const path = require('path')

/**
 * Will get every Dir in the current dir ( will get all the plugins )
 * @param {string} srcpath - The base dir to scan in.
 * @copyright http://stackoverflow.com/a/24594123/3557299
 */
function getDirectories (srcpath) {
  return fs.readdirSync(srcpath)
    .filter(file => fs.statSync(path.join(srcpath, file)).isDirectory())
}

/**
 * Will load all the given module paths
 * @param {array} modules - an array of strings ( module paths )
 * @return array of module's names and its refs
 */
function requireModulesFromArray (modules) {
  const _modules = []
  modules.forEach(function (module) {
    let _module = require(path.join(__dirname, module))
    _modules.push({
      'name': module,
      'ref': _module
    })
  })
  return _modules
}
module.exports = requireModulesFromArray(getDirectories(__dirname))<commit_msg>made adjustments to get it to work with UglifyJS which aparently doesn't support ES6<commit_after>const fs = require('fs')
const path = require('path')

/**
 * Will get every Dir in the current dir ( will get all the plugins )
 * @param {string} srcpath - The base dir to scan in.
 * @copyright http://stackoverflow.com/a/24594123/3557299
 */
function getDirectories (srcpath) {
  return fs.readdirSync(srcpath)
    .filter(function(file){
      return fs.statSync(path.join(srcpath, file)).isDirectory()
    })
}

/**
 * Will load all the given module paths
 * @param {array} modules - an array of strings ( module paths )
 * @return array of module's names and its refs
 */
function requireModulesFromArray (modules) {
  const _modules = []
  modules.forEach(function (module) {
    const _module = require(path.join(__dirname, module))
    _modules.push({
      'name': module,
      'ref': _module
    })
  })
  return _modules
}
module.exports = requireModulesFromArray(getDirectories(__dirname))
{'fraction_non_alphanumeric': 0.12039957939011567, 'fraction_numerical': 0.01629863301787592, 'mean_word_length': 3.917312661498708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6369632', 'n_tokens_mistral': 586, 'n_tokens_neox': 567, 'n_words': 177}