---------------------------------------------------------------------------- the require function ----------------------------------------------------------------------------
435142
function get_require(currentModule) {
    var result = function require(moduleId) {

        if (moduleId.match(/^\.{1,2}\//)) {
            moduleId = normalize(currentModule, moduleId)
        }

        if (hop(ModuleStore, moduleId)) {
            var module = ModuleStore[moduleId]
            if (module.__isLoading) {
                if (WarnOnRecursiveRequire) {
                    var fromModule = currentModule ? currentModule.id : "<root>"
                    console.log("module '" + moduleId + "' recursively require()d from '" + fromModule + "', problem?")
                }
            }

            currentModule.moduleIdsRequired.push(moduleId)

            return module.exports
        }

        if (!hop(ModulePreloadStore, moduleId)) {
            var fromModule = currentModule ? currentModule.id : "<root>"
            error("module '" + moduleId + "' not found from '" + fromModule + "', must be define()'d first")
        }

        var factory = ModulePreloadStore[moduleId][0]
        var prereqs = ModulePreloadStore[moduleId][1]

        var module = create_module(moduleId)

        var newRequire = get_require(module)

        ModuleStore[moduleId] = module

        module.__isLoading = true
        try {
            currentModule.moduleIdsRequired.push(moduleId)

            var prereqModules = []
            for (var i=0; i<prereqs.length; i++) {
                var prereqId = prereqs[i]
                var prereqModule

                if      (prereqId == "require") prereqModule = newRequire
                else if (prereqId == "exports") prereqModule = module.exports
                else if (prereqId == "module")  prereqModule = module
                else                            prereqModule = newRequire(prereqId)

                prereqModules.push(prereqModule)
            }

            if (typeof factory == "function") {
                var result = factory.apply(null, prereqModules)
                if (result) {
                    module.exports = result
                }
            }
            else {
                module.exports = factory
            }
        }
        finally {
            module.__isLoading = false
        }

        return module.exports
    }

    result.define         = require_define
    result.implementation = PROGRAM
    result.version        = VERSION

    return result
}
909622
function(callback) {

            try {
                var controller = require(path);
                callback(null, controller);
            } catch (e) {
                return callback(e);
            }
        }
1040131
function requireValidate(path, optional = false) {
  let driver;

  try {
    driver = require(path);
  } catch (er) {
    if (optional) {
      console.log('optional driver ' + path + ' not available');
      return;
    } else {
      // rethrow
      throw er;
    }
  }

  if (!driver.id) {
    console.error(`${path} must export a unique id`);
    process.exit(1);
  }

  if (!driver.name) {
    console.error(`${path} must export a name`);
    process.exit(1);
  }

  if (drivers[driver.id]) {
    console.error(`Driver with id ${driver.id} already loaded`);
    console.error(`Ensure ${path} has a unique id exported`);
    process.exit(1);
  }

  validateFunction(path, driver, 'getSchema');
  validateFunction(path, driver, 'runQuery');
  validateFunction(path, driver, 'testConnection');
  validateArray(path, driver, 'fields');

  driver.fieldsByKey = {};

  driver.fields.forEach(field => {
    driver.fieldsByKey[field.key] = field;
  });

  drivers[driver.id] = driver;
}
768270
function require(name, jumped){
    if (cache[name]) return cache[name].exports;
    if (modules[name]) return call(name, require);
    throw new Error('cannot find module "' + name + '"');
  }
178982
function load(filename) {

  return function(cb) {
    var file = path.join(process.cwd(), filename)
      , json = require(file)
      , model = exports[json.table]
      , rows = json.rows;

    console.log('Loading', file);

    run();
    function run() {
      var row = rows.shift();
      if(row !== undefined) {
        model.create(row, function(err) {
          if(err) {
            cb(err);
          } else {
            run();
          }
        });
      } else {
        cb();
      }
    }
  };
}
891091
function requireModel(modelName, full) {
		if(!modelName) {
			return false;
		}

		var model = this.models[modelName];

		if(full) {
			return (model ? model : false);
		}
		return (model ? model.serverModel : false);
	}
270783
function requireClass(className) {
		if(!className) {
			return false;
		}

		var theClass;

		try {
			theClass = require(path.join(this.root, '/app/classes/' + className));
		}
		catch(err) {
			theClass = undefined;
			this.log.error(err);
		}

		return theClass;
	}
420994
def add_require(self, require):
        
        for p in self.requires:
            if p.value == require.value:
                return
        self.requires.append(require)
1108204
function require(path) {
  var module = require.modules[path];
  if(!module) {
    throw("couldn't find module for: " + path);
  }
  if(!module.exports) {
    module.exports = {};
    module.call(module.exports, module, module.exports, require.bind(path));
  }
  return module.exports;
}
645528
function RequireFilter(inputTree, options) {
  if (!(this instanceof RequireFilter)) {
    return new RequireFilter(inputTree, options);
  }

  Filter.call(this, inputTree, options); // this._super()

  options = options || {};

  this.inputTree = inputTree;
  this.files = options.files || [];
  this.description = options.description;
  this.amdPackages = options.amdPackages || [];
  this.amdModules = options.amdModules;
  this.excludePaths = options.excludePaths;
}
749345
function loadFile(dir, filename) {
  if (filename == null) return {}
  filename = path.join(dir, filename)
  try {
    return require(filename)
  } catch(e) {
    return {}
  }
}
1290628
function requireOrThrow(name) {
	try {
		return require(name);
	} catch (error) {
		log.fail('reshape-tape', `${name} failed to load`);

		return process.exit(1);
	}
}
842986
function tryRequire(name, def, isRoot) {
    function _require() {
        if (!is_1.isNode())
            /* istanbul ignore next */
            return to_1.toDefault(null, def);
        if (isRoot)
            return require.main.require(name);
        return require(name);
    }
    return tryWrap(_require)(def);
}
1273301
function moduleLoaded(resolve, requires, modName, data, loadedModuleData, alreadyMinified){
    // Check for any modules used from this module that we don't already have
    var newRequires = getModulesRequired(data);
    console.log(" - "+modName+" requires "+JSON.stringify(newRequires));
    // if we need new modules, set them to load and get their promises
    var newPromises = [];
    for (var i in newRequires) {
      if (requires.indexOf(newRequires[i])<0) {
        console.log("   Queueing "+newRequires[i]);
        requires.push(newRequires[i]);
        newPromises.push(loadModule(requires, newRequires[i], loadedModuleData));
      } else {
        console.log("   Already loading "+newRequires[i]);
      }
    }

    var loadProcessedModule = function (module) {
      // add the module to the beginning of our array
      if (Espruino.Config.MODULE_AS_FUNCTION)
        loadedModuleData.unshift("Modules.addCached(" + JSON.stringify(module.name) + ",function(){" + module.code + "});");
      else
        loadedModuleData.unshift("Modules.addCached(" + JSON.stringify(module.name) + "," + JSON.stringify(module.code) + ");");
      // if we needed to load something, wait until we have all promises complete before resolving our promise!
      Promise.all(newPromises).then(function(){ resolve(); });
    }
    if (alreadyMinified)
      loadProcessedModule({code:data,name:modName});
    else
      Espruino.callProcessor("transformModuleForEspruino", {code:data,name:modName}, loadProcessedModule);
  }
1245745
function patchRequire(require) {
        if (require.patched) {
            return require;
        }
        function casperBuiltinPath(path) {
            var absPath = fs.pathJoin(phantom.casperPath, 'modules', path + '.js');
            return fs.isFile(absPath) ? absPath : undefined;
        }
        function localModulePath(path) {
            var baseDir = phantom.casperScriptBaseDir || fs.workingDirectory;
            var paths = [
                fs.absolute(fs.pathJoin(baseDir, path)),
                fs.absolute(fs.pathJoin(baseDir, path + '.js'))
            ];
            return paths.filter(function(path) {
                return fs.isFile(path);
            }).pop();
        }
        var patchedRequire = function patchedRequire(path) {
            var moduleFilePath = casperBuiltinPath(path);
            if (moduleFilePath) {
                return require(moduleFilePath);
            }
            moduleFilePath = localModulePath(path);
            if (moduleFilePath) {
                return require(moduleFilePath);
            }
            try {
                return require(path);
            } catch (e) {
                throw new CasperError("Can't find module " + path);
            }
        };
        patchedRequire.cache = require.cache;
        patchedRequire.extensions = require.extensions;
        patchedRequire.stubs = require.stubs;
        patchedRequire.patched = true;
        return patchedRequire;
    }
714842
function(input, source) {
  var output = input.toString();

  if (source.path.match(/\.js$/)) {
    output = output.replace(/(["'](do not )?use strict[\"\'];)/,
        'define(function(require, exports, module) {\n\n$1');
    output += '\n\n});\n';
  }

  return output;
}
1275264
function(path, callback) {
        callback = callback || noop;

        //requirejs style
        if(path instanceof Array) {
            return loadArray(path, function() {
                var args = Array.prototype.slice.apply(arguments);

                //delay the callback to match the
                //order of precached and unloaded
                setTimeout(function() {
                    callback.apply(null, args);
                });
            }, [], true);
        }

        // node style
        return acquire.loadPath(path, callback, true);
    }