Map<String, String> packageDetails = new HashMap<String, String>();
// Run script parser on each file, pulling out requires and provides
while(packageJsFilesIter.hasNext()) {
String fileContents = FileUtils.readFileToString(packageJsFilesIter.next());
ScriptParser scriptParser = new ScriptParser(fileContents);
// Add all module dependencies discovered to global state holder
modulesProvided.addAll(scriptParser.retrieveModuleProvides());
modulesRequired.addAll(scriptParser.retrieveModuleRequires());
}
// Store package modules, requires & provides, in response JSON.
temporaryPackageDetails.put("requiredDojoModules", modulesRequired);
temporaryPackageDetails.put("availableModules", modulesProvided);