old_contents: 'use strict';
  
  var path = require('path');
  var resolveUp = require('resolve-up');
  var reduce = require('lodash')._.reduce;
  
  /**
   * Load generators onto the `generators` object
   */
  
  module.exports = function generators_() {
    this.generators = this.generators || {};
    var pattern = this.option('generator pattern') || 'generate-*';
  
    reduce(resolveUp(pattern), function (acc, dir) {
      var json = require(path.resolve(dir, 'package.json'));
      if (!json.main) return acc;
  
      var fp = path.resolve(dir, json.main);
      acc[path.basename(dir)] = require(path.resolve(fp));
      return acc;
    }, this.generators);
  };
  
new_contents: 'use strict';
  
  var resolveUp = require('resolve-up');
  var path = require('path');
  var _ = require('lodash');
  
  /**
   * Load generators onto the `generators` object
   */
  
  module.exports = function generators_() {
    this.generators = this.generators || {};
    var pattern = this.option('generator pattern') || 'generate-*';
  
    _.reduce(resolveUp(pattern), function (acc, dir) {
      var json = require(path.resolve(dir, 'package.json'));
      if (!json.main) return acc;
  
      var fp = path.resolve(dir, json.main);
      acc[path.basename(dir)] = require.resolve(path.resolve(fp));
      return acc;
    }, this.generators);
  };
  
subject: use `require.resolve` so the generator can be called elsewhere