npm-crawl.js
function(context, pkg, isRoot) {
		var deps = crawl.getDependencies(context.loader, pkg, isRoot);

		return Promise.all(utils.filter(utils.map(deps, function(childPkg){
			return crawl.fetchDep(context, pkg, childPkg, isRoot);
		}), truthy)).then(function(packages){
 			// at this point all dependencies of pkg have been loaded, it's ok to get their children

			return Promise.all(utils.map(packages, function(childPkg){
				// Also load 'steal' so that the builtins will be configured
				if(childPkg && childPkg.name === 'steal') {
					return crawl.deps(context, childPkg);
				}
			})).then(function(){
				return packages;
			});
		});
	}
function(context, pkg, isRoot) {
		var deps = crawl.getDependencies(context.loader, pkg, isRoot);

		return Promise.all(utils.filter(utils.map(deps, function(childPkg){
			return crawl.fetchDep(context, pkg, childPkg, isRoot);
		}), truthy)).then(function(packages){
 			// at this point all dependencies of pkg have been loaded, it's ok to get their children

			return Promise.all(utils.map(packages, function(childPkg){
				// Also load 'steal' so that the builtins will be configured
				if(childPkg && childPkg.name === 'steal') {
					return crawl.deps(context, childPkg);
				}
			})).then(function(){
				return packages;
			});
		});
	}
function ( context , pkg , isRoot ) { var deps = crawl . getDependencies ( context . loader , pkg , isRoot ) ; return Promise . all ( utils . filter ( utils . map ( deps , function ( childPkg ) { return crawl . fetchDep ( context , pkg , childPkg , isRoot ) ; } ) , truthy ) ) . then ( function ( packages ) { // at this point all dependencies of pkg have been loaded, it's ok to get their children return Promise . all ( utils . map ( packages , function ( childPkg ) { // Also load 'steal' so that the builtins will be configured if ( childPkg && childPkg . name === 'steal' ) { return crawl . deps ( context , childPkg ) ; } } ) ) . then ( function ( ) { return packages ; } ) ; } ) ; }
Crawls the packages dependencies
@param {Object} context
@param {NpmPackage} pkg
@param {Boolean} [isRoot] If the root module's dependencies should be crawled.
@return {Promise} A promise when all packages have been loaded
Crawls the packages dependencies