function getPkgs( pkgs, dir, clbk ) {
	var errFLG;
	var count;
	var opts;
	var len;
	var out;
	var i;

	len = pkgs.length;
	debug( 'Resolving %d packages...', len );

	out = new Array( len );
	count = 0;
	for ( i = 0; i < len; i++ ) {
		debug( 'Resolving package: %s (%d of %d).', pkgs[ i ], i+1, len );
		opts = {
			'basedir': dir
		};
		out[ i ] = {
			'id': pkgs[ i ],
			'main': null
		};
		resolve( pkgs[ i ], opts, createClbk( i ) );
	}
	/**
	* Returns a callback to be invoked upon resolving a package.
	*
	* @private
	* @param {NonNegativeInteger} idx - index
	* @returns {Callback} callback
	*/
	function createClbk( idx ) {
		var name = pkgs[ idx ];
		var k = idx + 1;

		return onResolve;

		/**
		* Callback to be invoked upon resolving a package.
		*
		* @private
		* @param {(Error|null)} error - error object
		* @param {string} main - main entry point
		* @param {Object} [pkg] - `package.json` contents
		* @returns {void}
		*/
		function onResolve( error, main ) {
			if ( errFLG ) {
				return;
			}
			if ( error ) {
				debug( 'Encountered an error while resolving package: %s (%d of %d). Error: %s', name, k, len, error.message );
				errFLG = true;
				return clbk( error );
			}
			debug( 'Resolved package: %s (%d of %d). Main: %s.', name, k, len, main );
			out[ idx ].main = main;
			count += 1;
			debug( 'Resolved %d of %d packages.', count, len );
			if ( count === len ) {
				debug( 'Resolved all packages.' );
				return clbk( null, out );
			}
		}
	}
}
Resolves a list of packages.

@private
@param {StringArray} pkgs - list of packages
@param {string} dir - base directory from which to resolve packages
@param {Callback} clbk - callback to invoke after resolving packages