https://github.com/orestbida/link-prefetcher
Eager link prefetcher.
https://github.com/orestbida/link-prefetcher
fast fetch hover links prefetch
Last synced: 4 months ago
JSON representation
Eager link prefetcher.
- Host: GitHub
- URL: https://github.com/orestbida/link-prefetcher
- Owner: orestbida
- License: mit
- Created: 2023-03-04T01:10:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T21:25:55.000Z (about 3 years ago)
- Last Synced: 2025-10-19T07:54:26.281Z (8 months ago)
- Topics: fast, fetch, hover, links, prefetch
- Language: JavaScript
- Homepage:
- Size: 37.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# link-prefetcher


[](https://github.com/orestbida/link-prefetcher/actions/workflows/build.yml)
A tiny link prefetcher (yet another one in the sea of prefetching tools). Uses `fetch`/`xhr` to prefetch links rather than the `link` tag.
### `prefetchHover()`
Start prefetching as soon as possible. Abort if the cursor leaves the anchor tag before the prefetch process is done.
### `prefetchVisible()`
Immediately prefetch all visible links (⚠️ use with caution, can eat up a lot of bandwidth).
## Installation
```bash
npm i @orestbida/link-prefetcher
```
## Usage
```javascript
import { prefetchHover } from 'link-prefetcher';
prefetchHover();
```
or
```html
window.addEventListener('load', () => {
LinkPrefetcher.prefetchHover()
});
```
## License
Distributed under the MIT License. See [LICENSE](./LICENSE) for more information.