# prefetch-anchor-web-component

> web components anchor element for prefetching target's html.

Latest version **1.1.0** (published 2021-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install prefetch-anchor-web-component
pnpm add prefetch-anchor-web-component
yarn add prefetch-anchor-web-component
bun add prefetch-anchor-web-component
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-06-02 |
| First published | 2021-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | shinyaigeek |
| Maintainers | shinyaigeek |
| Keywords | web components, performance, prefetch |

## Links

- npm: https://www.npmjs.com/package/prefetch-anchor-web-component
- Repository: https://github.com/Shinyaigeek/prefetch-anchor-web-component
- Homepage: https://github.com/Shinyaigeek/prefetch-anchor-web-component#readme
- Issues: https://github.com/Shinyaigeek/prefetch-anchor-web-component/issues
- npm.io page: https://npm.io/package/prefetch-anchor-web-component

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-06-02
- 1.0.1 — 2021-06-02
- 1.0.0 — 2021-06-02
- 0.0.1 — 2021-06-02

## README

# prefetch-anchor
web components anchor element for prefetching target's html.

Be careful not to overuse

## Example

```html
<!DOCTYPE html>
<html>
  <head>
    <script src="https://cdn.jsdelivr.net/npm/prefetch-anchor-web-component@1.1.0/lib/main.js" ></script>
  </head>
  <body>
    hello prefetch anchor!!

    <a>resource</a>
    <a is="prefetch-anchor">resource which you want to preload</a>
  </body>
</html>
```

## How to use

1. define `prefetch-anchor` customElement via https://cdn.jsdelivr.net/npm/prefetch-anchor-web-component@1.1.0/lib/main.js with `<script />`
2. add `prefetch-anchor` value to `is` attribute in `<a />`

if you want to use this component also in legacy browser, I recommend to use https://cdn.jsdelivr.net/npm/prefetch-anchor-web-component@1.1.0/lib/main.old.js and use https://github.com/w3c/IntersectionObserver/tree/main/polyfill to polyfill IntersectionObserver API and use https://github.com/webcomponents/polyfills to polyfill customElement.

---
_Source: https://npm.io/package/prefetch-anchor-web-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
