function entryPoints( pkgs ) {
	var total;
	var main;
	var file;
	var keys;
	var data;
	var tmp;
	var bin;
	var out;
	var dir;
	var pkg;
	var id;
	var b;
	var i;
	var j;
	var k;

	total = pkgs.length;
	out = [];

	debug( 'Determining main entry points for %d packages...', total );
	for ( i = 0; i < total; i++ ) {
		k = i + 1;
		pkg = pkgs[ i ].pkg;
		main = pkgs[ i ].id;

		debug( 'Determined main entry point for package: %s (%d of %d). Main: %s', pkg, k, total, main );
		out.push({
			'id': main,
			'pkg': pkg,
			'dir': pkgs[ i ].dir,
			'entries': [
				main
			]
		});
	}
	debug( 'Finished determining main entry points.' );

	debug( 'Resolving browser entry points for %d packages...', total );
	for ( i = 0; i < total; i++ ) {
		k = i + 1;
		pkg = pkgs[ i ].pkg;
		data = pkgs[ i ].data;
		if (
			data.__stdlib__ && // eslint-disable-line no-underscore-dangle
			data.__stdlib__.envs && // eslint-disable-line no-underscore-dangle
			data.__stdlib__.envs.browser === false // eslint-disable-line no-underscore-dangle
		) {
			debug( 'Package is not compatible with browser environments: %s (%d of %d). Skipping...', pkg, k, total );
			continue;
		}
		debug( 'Resolving browser files for package: %s (%d of %d).', pkg, k, total );
		id = pkgs[ i ].id;
		dir = pkgs[ i ].dir;
		b = data.browser;

		tmp = [];
		if ( isString( b ) && b.length > 0 ) {
			file = resolve( dir, b );
			debug( 'Found browser entry file for package: %s (%d of %d). File: %s', pkg, k, total, file );
			tmp.push( file );
		} else if ( isObject( b ) ) {
			keys = objectKeys( b );
			for ( j = 0; j < keys.length; j++ ) {
				if ( resolve( dir, keys[j] ) === id ) {
					file = resolve( dir, b[ keys[j] ] );
					debug( 'Found browser entry file for package: %s (%d of %d). File: %s', pkg, k, total, file );
					tmp.push( file );
				}
			}
		} else {
			debug( 'No browser-specific files for package: %s (%d of %d).', pkg, k, total );
			continue;
		}
		tmp = resolveFiles( tmp );
		if ( tmp instanceof Error ) {
			return tmp;
		}
		out[ i ].entries = out[ i ].entries.concat( tmp );
		debug( 'Resolved %d browser entry points for package: %s (%d of %d).', out[ i ].entries.length, pkg, k, total );
	}

	debug( 'Resolving executable files for %d packages...', total );
	for ( i = 0; i < total; i++ ) {
		k = i + 1;
		pkg = pkgs[ i ].pkg;

		dir = pkgs[ i ].dir;
		bin = pkgs[ i ].data.bin;

		tmp = [];

		debug( 'Resolving executable files for package: %s (%d of %d).', pkg, k, total );
		if ( isString( bin ) && bin.length > 0 ) {
			file = resolve( dir, bin );
			debug( 'Found executable file for package: %s (%d of %d). File: %s', pkg, k, total, file );
			tmp.push( file );
		} else if ( isObject( bin ) ) {
			keys = objectKeys( bin );
			for ( j = 0; j < keys.length; j++ ) {
				file = resolve( dir, bin[ keys[j] ] );
				debug( 'Found executable file for package: %s (%d of %d). File: %s', pkg, k, total, file );
				tmp.push( file );
			}
		} else {
			debug( 'No executable files for package: %s (%d of %d).', pkg, k, total );
			continue;
		}
		tmp = resolveFiles( tmp );
		if ( tmp instanceof Error ) {
			return tmp;
		}
		out[ i ].entries = out[ i ].entries.concat( tmp );
		debug( 'Resolved %d entry points for package: %s (%d of %d).', out[ i ].entries.length, pkg, k, total );
	}
	debug( 'Resolved entry points for all packages.' );
	return out;
}
Determines entry points.

@private
@param {ObjectArray} pkgs - packages
@returns {(ObjectArray|Error)} results or an error