prefetchit

A naive prefetch for the browser

Usage no npm install needed!

<script type="module">
  import prefetchit from 'https://cdn.skypack.dev/prefetchit';
</script>

README

prefetchit

Version Build Status Coverage Dependencies Vulnerabilities License Types

A naive prefetch for the browser.

Install

npm install prefetchit

Usage

prefetchit will add a <link rel="prefetch" href="asset.ext" /> to the current document head for each resource passed, filtering for duplications.

add(asset: string): void

import prefetch from 'prefetchit';

prefetch.add('./my-res.png');
prefetch.add('./my-other-res.png');

bulk(...asset: string): void

import prefetch from 'prefetchit';

prefetch.bulk('./my-res.png', './my-other-res.png');