function resolve( opts, clbk ) {
	var options;
	var retries;
	var offset;
	var cache;

	options = getOptions( opts ); // request options
	offset = 0;
	retries = 0;

	cache = Object.create( null ); // no prototype

	debug( 'Resolving dependents.' );
	return next( offset );

	/**
	* Retrieves the next page.
	*
	* @private
	* @param {NonNegativeInteger} offset - query offset
	*/
	function next( offset ) {
		options.path = urlpath( opts.pathname, offset );
		debug( 'Request path: %s', options.path );

		request( options, onResource );
	}

	/**
	* Callback invoked upon receiving an HTTP response.
	*
	* @private
	* @param {(Error|null)} error - error or null
	* @param {Object} response - HTTP response object
	* @param {string} body - response body
	* @returns {void}
	*/
	function onResource( error, response, body ) {
		var selection;
		var $;
		if ( error ) {
			if (
				error.status === 429 || // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
				error.status === 503 || // https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503
				error.message.indexOf( 'Too Many Requests' ) >= 0 ||
				error.message.indexOf( 'Service Unavailable' ) >= 0
			) {
				retries += 1;
				if ( retries > MAX_RETRIES ) {
					debug( 'Maximum number of retries exceeded. Status: %d. Error: %s', error.status, error.message );
					return done( error );
				}
				debug( 'Encountered an error. Status: %d. Error: %s', error.status, error.message );
				return setTimeout( retry, exp2( retries ) * DELAY );
			}
			return done( error );
		}
		// Reset the retry counter:
		retries = 0;

		$ = cheerio.load( body );
		selection = $( 'a[href^="/package/"]' );

		debug( 'Found %d package links.', selection.length-1 );
		if ( selection.length <= 1 ) {
			return done();
		}
		selection.each( onElement );

		offset += STRIDE;
		return next( offset );

		/**
		* Callback invoked on finding a package link.
		*
		* @private
		* @param {NonNegativeInteger} i - index
		* @param {Element} el - element
		*/
		function onElement( i, el ) {
			var d = $( el ).attr( 'href' ).slice( '/package/'.length );
			if ( d !== opts.pkg && cache[ d ] === void 0 ) {
				cache[ d ] = true;
			}
		}
	}

	/**
	* Retries a request.
	*
	* @private
	*/
	function retry() {
		debug( 'Retrying request (%d of %d).', retries, MAX_RETRIES );
		next( offset );
	}

	/**
	* Callback invoked upon resolving resources.
	*
	* @private
	* @param {Error} [error] - error object
	* @returns {void}
	*/
	function done( error ) {
		if ( error ) {
			return clbk( error );
		}
		debug( 'Request completed.' );
		return clbk( null, objectKeys( cache ) );
	}
}
Resolves package dependents.

@private
@param {Object} opts - options
@param {Callback} clbk - callback to invoke after resolving package dependents
@returns {void}