<commit_before>'use strict';

var _path = require('path');

/**
 * Helper to check if a npm module is a plugin
 * The logic is: is plugin if the npm module package.json have the wejs-plugin keyword
 *
 * @param  {String}  nodeModulePath
 * @return {Boolean}
 */
module.exports = function isPlugin(nodeModulePath) {
  var pkg = require((0, _path.resolve)(nodeModulePath, 'package.json'));

  if (pkg.keywords && pkg.keywords.indexOf('wejs-plugin') !== -1) {
    return true;
  } else {
    return false;
  }
};<commit_msg>update isPlugin to handle errors from require<commit_after>'use strict';

var _path = require('path');

/**
 * Helper to check if a npm module is a plugin
 * The logic is: is plugin if the npm module package.json have the wejs-plugin keyword
 *
 * @param  {String}  nodeModulePath
 * @return {Boolean}
 */
module.exports = function isPlugin(nodeModulePath) {
  var pkg = void 0;
  try {
    pkg = require((0, _path.resolve)(nodeModulePath, 'package.json'));
  } catch (e) {
    return false;
  }

  if (pkg.keywords && pkg.keywords.indexOf('wejs-plugin') !== -1) {
    return true;
  } else {
    return false;
  }
};
{'fraction_non_alphanumeric': 0.13796133567662566, 'fraction_numerical': 0.004393673110720563, 'mean_word_length': 3.592741935483871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '790831', 'n_tokens_mistral': 377, 'n_tokens_neox': 360, 'n_words': 116}