<commit_before>const path = require('path');
const findPlugins = require('./findPlugins');

/**
 * @return {Array} Array of commands
 */
module.exports = function getCommands() {
  const appRoot = process.cwd();

  return findPlugins([appRoot]).map(name => require(path.join(appRoot, 'node_modules', name)));
};<commit_msg>Flattens RNPM user commands from plugin modules<commit_after>const path = require('path');
const findPlugins = require('./findPlugins');
const flatten = require('lodash').flatten;

/**
 * @return {Array} Array of commands
 */
module.exports = function getCommands() {
  const appRoot = process.cwd();
  const plugins = findPlugins([appRoot]).map(name => require(path.join(appRoot, 'node_modules', name)));
  return flatten(plugins);
};
{'fraction_non_alphanumeric': 0.16490765171503957, 'fraction_numerical': 0.0, 'mean_word_length': 5.837837837837838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3209409', 'n_tokens_mistral': 226, 'n_tokens_neox': 224, 'n_words': 56}