function resolveFromHosted (nodeModules, parentTarget, parsedSpec) {
	const {raw, name, type, hosted} = parsedSpec
	log(`resolving ${raw} from ${hosted.type}`)

	const [provider, shortcut] = hosted.shortcut.split(':')
	const [repo, ref = 'master'] = shortcut.split('#')

	const options = {...config.httpOptions, retries: config.retries}
	// create shasum from directUrl for storage
	const hash = crypto.createHash('sha1')
	hash.update(hosted.directUrl)
	const shasum = hash.digest('hex')

	let tarball
	switch (hosted.type) {
		case 'github':
			tarball = url.resolve('https://codeload.github.com', `${repo}/tar.gz/${ref}`)
			break
		case 'bitbucket':
			tarball = url.resolve('https://bitbucket.org', `${repo}/get/${ref}.tar.gz`)
			break
		default:
			throw new Error(`Unknown hosted type: ${hosted.type} for ${name}`)
	}

	return registry.fetch(hosted.directUrl, options)
		::map(({body}) => JSON.parse(body))
		::map(pkgJson => {
			pkgJson.dist = {tarball, shasum} // eslint-disable-line no-param-reassign
			log(`resolved ${name}@${ref} to directUrl shasum ${shasum} from ${provider}`)
			return {parentTarget, pkgJson, target: shasum, name: pkgJson.name, type, fetch}
		})
}
resolve a dependency's `package.json` file from an hosted GitHub-like registry.
@param	{String} nodeModules - `node_modules` base directory.
@param	{String} parentTarget - relative parent's node_modules path.
@param	{Object} parsedSpec - parsed package name and specifier.
@return {Observable} - observable sequence of `package.json` objects.