used to require .njs files
176885
function requireNJS() {
  try {
    var module = ru(this.path);
  } catch(o_O) {
    console.error(o_O);
    return internalServerError.call(this, o_O);
  }
  module.onload(
    this.request,
    this.response,
    this
  );
}
262642
function bundleJsFiles () {
  return concat(jsFiles)
    .then((output) => {
      const uglified = UglifyJS.minify(output)
      if (uglified.error) {
        throw new Error(uglified.error)
      }
      return uglified.code
    })
}
702076
function(file, done){
      var ext = path.extname(file);
      if(!ssr.helpers.shouldIgnore(file) && ['.jade', '.ejs', '.md', '.styl', '.less', '.scss', '.sass', '.coffee', 'pug'].indexOf(ext) === -1){
        var localPath = path.resolve(outputPath, file);
        fs.mkdirp(path.dirname(localPath), function(err){
          fs.copy(path.resolve(setup.publicPath, file), localPath, done);
        });
      }else{
        done();
      }
    }
986079
function allJavascriptFiles() {
        return srcFiles().concat(otherJsFiles()).concat(unitTestFiles()).concat(unitTestHelperFiles()).concat(taskFiles()).concat(commonJsFiles());
    }
919074
function allJasmineJsFiles(rootDir) {
  var files = [];
  fs.readdirSync(rootDir).filter(function(filename) {

    var fullPath = rootDir + "/" + filename;
    if (fs.statSync(fullPath).isDirectory() && !fullPath.match(/pages/)) {
      var subDirFiles = allJasmineJsFiles(fullPath);
      if (subDirFiles.length > 0) {
        files = files.concat();
        return true;
      }
    } else {
      if (fullPath.match(/\.js$/) && !isExcluded(fullPath)) {
        files.push(fullPath);
        return true;
      }
    }
    return false;
  });

  return files;
}
962604
function loadJsFile(file) {
    var modId = path.basename(file).slice(0, -3);
    var mod = require(file);
    modulePath[modId] = file;
    mod.__id = modId;
    return mod;
}
632419
def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
        """"""
        unnamed = list(self.unnamed_requirements)
        reqs = list(self.requirements.values())
        while reqs or unnamed:
            if unnamed:
                req_to_install = unnamed.pop(0)
            else:
                req_to_install = reqs.pop(0)
            req_version = None
            install = True
            best_installed = False
            if not self.ignore_installed and not req_to_install.editable:
                req_to_install.check_if_exists()
                if req_to_install.satisfied_by:
                    if self.upgrade:
                        if not self.force_reinstall:
                            try:
                                url, req_version = finder.find_requirement(
                                    req_to_install, self.upgrade)
                            except BestVersionAlreadyInstalled:
                                best_installed = True
                                install = False
                            else:
                                # Avoid the need to call find_requirement again
                                req_to_install.url = url.url

                        if not best_installed:
                            req_to_install.conflicts_with = req_to_install.satisfied_by
                            req_to_install.satisfied_by = None
                    else:
                        install = False
                if req_to_install.satisfied_by:
                    if best_installed:
                        logger.notify('Requirement already up-to-date: %s'
                                      % req_to_install)
                    else:
                        logger.notify('Requirement already satisfied '
                                      '(use --upgrade to upgrade): %s'
                                      % req_to_install)
            if req_to_install.editable:
                logger.notify('Obtaining %s' % req_to_install)
            elif install:
                if req_to_install.url and req_to_install.url.lower().startswith('file:'):
                    logger.notify('Unpacking %s' % display_path(url_to_path(req_to_install.url)))
                else:
                    logger.notify('Downloading/unpacking %s' % req_to_install)
            logger.indent += 2
            try:
                is_bundle = False
                if req_to_install.editable:
                    if req_to_install.source_dir is None:
                        location = req_to_install.build_location(self.src_dir)
                        req_to_install.source_dir = location
                    else:
                        location = req_to_install.source_dir
                    if not os.path.exists(self.build_dir):
                        _make_build_dir(self.build_dir)
                    req_to_install.update_editable(not self.is_download)
                    if self.is_download:
                        req_to_install.run_egg_info()
                        req_to_install.archive(self.download_dir)
                    else:
                        req_to_install.run_egg_info()
                elif install:
                    ##@@ if filesystem packages are not marked
                    ##editable in a req, a non deterministic error
                    ##occurs when the script attempts to unpack the
                    ##build directory

                    location = req_to_install.build_location(self.build_dir, not self.is_download)
                    ## FIXME: is the existance of the checkout good enough to use it?  I don't think so.
                    unpack = True
                    if not os.path.exists(os.path.join(location, 'setup.py')):
                        ## FIXME: this won't upgrade when there's an existing package unpacked in `location`
                        if req_to_install.url is None:
                            url, req_version = finder.find_requirement(req_to_install, upgrade=self.upgrade)
                        else:
                            ## FIXME: should req_to_install.url already be a link?
                            url = Link(req_to_install.url)
                            assert url
                        if url:
                            try:
                                self.unpack_url(req_to_install, req_version, url, location, self.is_download)
                            except HTTPError:
                                e = sys.exc_info()[1]
                                logger.fatal('Could not install requirement %s because of error %s'
                                             % (req_to_install, e))
                                raise InstallationError(
                                    'Could not install requirement %s because of HTTP error %s for URL %s'
                                    % (req_to_install, e, url))
                        else:
                            unpack = False
                    if unpack:
                        is_bundle = req_to_install.is_bundle
                        url = None
                        if is_bundle:
                            req_to_install.move_bundle_files(self.build_dir, self.src_dir)
                            for subreq in req_to_install.bundle_requirements():
                                reqs.append(subreq)
                                self.add_requirement(subreq)
                        elif self.is_download:
                            req_to_install.source_dir = location
                            if url and url.scheme in vcs.all_schemes:
                                req_to_install.run_egg_info()
                                req_to_install.archive(self.download_dir)
                        else:
                            req_to_install.source_dir = location
                            req_to_install.run_egg_info()
                            if force_root_egg_info:
                                # We need to run this to make sure that the .egg-info/
                                # directory is created for packing in the bundle
                                req_to_install.run_egg_info(force_root_egg_info=True)
                            req_to_install.assert_source_matches_version()
                            #@@ sketchy way of identifying packages not grabbed from an index
                            if bundle and req_to_install.url:
                                self.copy_to_build_dir(req_to_install)
                                install = False
                        # req_to_install.req is only avail after unpack for URL pkgs
                        # repeat check_if_exists to uninstall-on-upgrade (#14)
                        req_to_install.check_if_exists()
                        if req_to_install.satisfied_by:
                            if self.upgrade or self.ignore_installed:
                                req_to_install.conflicts_with = req_to_install.satisfied_by
                                req_to_install.satisfied_by = None
                            else:
                                install = False
                if not is_bundle and not self.is_download:
                    ## FIXME: shouldn't be globally added:
                    finder.add_dependency_links(req_to_install.dependency_links)
                    if (req_to_install.extras):
                        logger.notify("Installing extra requirements: %r" % ','.join(req_to_install.extras))
                    if not self.ignore_dependencies:
                        for req in req_to_install.requirements(req_to_install.extras):
                            try:
                                name = pkg_resources.Requirement.parse(req).project_name
                            except ValueError:
                                e = sys.exc_info()[1]
                                ## FIXME: proper warning
                                logger.error('Invalid requirement: %r (%s) in requirement %s' % (req, e, req_to_install))
                                continue
                            if self.has_requirement(name):
                                ## FIXME: check for conflict
                                continue
                            subreq = InstallRequirement(req, req_to_install)
                            reqs.append(subreq)
                            self.add_requirement(subreq)
                    if req_to_install.name not in self.requirements:
                        self.requirements[req_to_install.name] = req_to_install
                else:
                    self.reqs_to_cleanup.append(req_to_install)
                if install:
                    self.successfully_downloaded.append(req_to_install)
                    if bundle and (req_to_install.url and req_to_install.url.startswith('file:///')):
                        self.copy_to_build_dir(req_to_install)
            finally:
                logger.indent -= 2
1206840
function mapFiles(files, relative, required) {
  if (!files) {
    return []
  }

  if (Array.isArray(files) === false) {
    files = [files]
  }

  return files.map(f => ({
    file: resolvePath(relative, f),
    required: required
  }))
}
1125843
function() {
        var that = this;
        var args = slice.call(arguments);

        each(args, function(arg) {
            var id = that.alias(arg);
            var type = fileType(id);
            var isComp = fileComponents(id);
            var res = {
                id: id
            };
            type = type === 'css' && isComp ? 'compcss' : (type === 'js' && isComp ? 'compjs' : type);

            that.push.apply(that, settings.deps[id]);

            if ((type === 'css') || (type === 'js') || (type === 'compcss') || (type === 'compjs')) {
                (that.depends[type] || (that.depends[type] = [])).push(res);
                ++that.length;
            }
        });
    }
72319
function (options, iterationInfo, modules) {
        // filename filter
        if (options.fileNameFilter) {
            var match = iterationInfo.fileName.match(options.fileNameFilter);
            if (!match) {
                return;
            }
        }

        // Filter spec.js files
        var match = iterationInfo.fileName.match(/.spec.js/i);
        if (match) {
            return;
        }

        // relative path filter
        if (options.relativePathFilter) {
            var pathMatch = iterationInfo.relativeFullPath.match(options.relativePathFilter);
            if (!pathMatch)
                return;
        }

        //load module
        loadModule(modules, options, iterationInfo);
    }
1024616
function(configObj, cb){
		var fs = require('fs');
		if(configObj.service && !configObj.module){
			if(configObj.modelSubFolder)
				var modelPath = configObj.service + "/" + configObj.modelSubFolder;
			else
				var modelPath = configObj.service;
			var files = fs.readdirSync("./services/"+modelPath+"/models");
			var fileCount = files.length;
			var counter = 0;
			files.forEach(function(file) {
				counter ++;
				var modelName = file.slice(0, -3);
				if(file.endsWith(".js")) {
					var model = require("../../services/"+modelPath+"/models/"+file);
					if(configObj.attachment){
						if(!configObj.attachment.models)
							configObj.attachment.models = {};
						configObj.attachment.models[modelName] = model.define(isnode, connections[configObj.name]);
					} else {
						var modelObj = model.define(isnode, connections[configObj.name]);
						isnode.module("services").service(configObj.service).models.add(modelName, modelObj);
					}
				}
				if(counter >= fileCount) { 
					log("debug","Data Module > Data Models Loaded for " + configObj.name + ".");
					if(cb){ cb(null, {success: true}); }
					return;
				}
			});
		} else if (configObj.module && !configObj.service) {
			if(configObj.modelSubFolder)
				var modelPath = configObj.module + "/" + configObj.modelSubFolder;
			else
				var modelPath = configObj.module;
			var files = fs.readdirSync("./node_modules/"+modelPath+"/models");
			var fileCount = files.length;
			var counter = 0;
			files.forEach(function(file) {
				counter ++;
				var moduleSplit = configObj.module.split("-");
				var modShortName = moduleSplit[2];
				var modelName = file.slice(0, -3);
				if(file.endsWith(".js")) {
					var model = require("../../node_modules/"+modelPath+"/models/"+file);
					if(configObj.attachment){
						if(!configObj.attachment.models)
							configObj.attachment.models = {};
						configObj.attachment.models[modelName] = model.define(isnode, connections[configObj.name]);
					} else {
						// Validate that this works...
						var mod = isnode.module(modShortName);
						if(!mod.models)
							mod.models = {};
						mod.models[modelName] = model.define(ismod.isnode, ismod.connections[configObj.name]);
					}
				}
				if(counter >= fileCount) { 
					log("debug","Data Module > Data Models Loaded for " + configObj.name + ".");
					if(cb){ cb(null, {success: true}); }
					return;
				}
			});
		} else if (configObj.module && configObj.service) {
			if(configObj.modelSubFolder)
				var modelPath = configObj.module + "/" + configObj.modelSubFolder;
			else
				var modelPath = configObj.module;
			var files = fs.readdirSync("./node_modules/"+modelPath+"/models");
			var fileCount = files.length;
			var counter = 0;
			files.forEach(function(file) {
				counter ++;
				var moduleSplit = configObj.module.split("-");
				var modShortName = moduleSplit[2];
				var modelName = file.slice(0, -3);
				if(file.endsWith(".js")) {
					var model = require("../../node_modules/"+modelPath+"/models/"+file);
					if(configObj.attachment){
						if(!configObj.attachment.models)
							configObj.attachment.models = {};
						configObj.attachment.models[modelName] = model.define(isnode, connections[configObj.name]);
					} else {
						var serviceManager = isnode.module("services");
						var service = serviceManager.service(configObj.service);
						if(!service[modShortName])
							service[modShortName] = {};
						if(!service[modShortName].models)
							service[modShortName].models = {};	
						service[modShortName].models[modelName] = model.define(ismod.isnode, ismod.connections[configObj.name]);
					}
				}
				if(counter >= fileCount) { 
					log("debug","Data Module > Data Models Loaded for " + configObj.name + ".");
					if(cb){ cb(null, {success: true}); }
					return; 
				}
			});
		} else {
			log("error","Data Module > Invalid database configuration - 'service' and/or 'module' must be specified.");
			var err = { message: "Invalid database configuration" }
			cb(err, null);
			return;
		}
	}
1172935
function cleanup() {
  const artifacts = ['.requirements'];
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      this.targetFuncs.forEach(f => {
        artifacts.push(path.join(f.module, '.requirements.zip'));
        artifacts.push(path.join(f.module, 'unzip_requirements.py'));
      });
    } else {
      artifacts.push('.requirements.zip');
      artifacts.push('unzip_requirements.py');
    }
  }

  return BbPromise.all(
    artifacts.map(artifact =>
      fse.removeAsync(path.join(this.servicePath, artifact))
    )
  );
}
713832
def setup(self):
        """"""
        super(RequireJSFilter, self).setup()

        excluded_files = []
        for bundle in self.excluded_bundles:
            excluded_files.extend(
                map(lambda f: os.path.splitext(f)[0],
                    bundle.contents)
            )

        if excluded_files:
            self.argv.append(
                'exclude={0}'.format(','.join(excluded_files))
            )
1285370
function requireJSAsync (file) {
	return new Promise(function (resolve, reject) {
		requireJS([ 'rvc!' + requireJSPath(file, '.html') ], resolve, reject);
	});
}
938916
File findNodeModulesNearestMatch(File requiringFile, String requireText) throws IOException {
        if ( requiringFile == null )
            return null;
        if ( !requireText.startsWith(".") ) {
            File f = new File(requiringFile, "node_modules/" + requireText);
            if (f.exists())
                return new File(TimeStampedFileCache.getCanonicalPath(f));
            f = new File(requiringFile, "node_modules/" + requireText + ".js");
            if (f.exists())
                return new File(TimeStampedFileCache.getCanonicalPath(f));
            return findNodeModulesNearestMatch(requiringFile.getParentFile(), requireText);
        } else {
            File f = new File(requiringFile.getParentFile(),requireText);
            if ( ! f.exists() )
                f =  new File(requiringFile.getParentFile(),requireText+".js");
            if ( f.exists() )
                return new File(TimeStampedFileCache.getCanonicalPath(f));
        }
        return null;
    }
509855
function $require(dir, file, dependencies) {
  var requiredFile = join(dir,file)
  try {
    var req = require(requiredFile)
    $logIt('app.require', `require`, `${dependencies?'wDeps'.yellow.dim:''}`.reset + requiredFile.gray)
    return dependencies ? req.apply(this,dependencies) : req
  } catch (e) {
    if (e.stack.match('SyntaxError')) {
      var src = fs.readFileSync(requiredFile+'.js')
      var err = syntax(src, requiredFile)
      console.log('\n\n$require.SyntaxError'.red, e.message.gray,
        err ? `\n\t${err} | col ${err.column}\n\n\n\n`.red : requiredFile.white)
      process.exit(1)
    }
    else
      console.log('\n\n\n$require.err'.red, requiredFile.white, e.message, '\n\n\n')

    throw e
  }

}
901619
function tree(root) {
	var structure = {};

	var _files = fs.readdirSync(root);
	for(var i=0; i<_files.length; i++) {
		if ((_files[i] !== '.') && (_files[i] !== '..')) {
			var stats = fs.statSync(root + '/' + _files[i]);
			if (stats.isDirectory()) {
				structure[_files[i]] = tree(root + '/' + _files[i]);
			} else if (stats.isFile() && xIsJsFile.test(_files[i])) {
				try {
					structure[_files[i]] = require(root + '/' + _files[i]);
				} catch(err) {
					console.log('Could not load task in: ' + _files[i]);
					console.error(err);
				}
			}
		}
	}

	return structure;
}