prefetchit
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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');

Readme

Keywords

Package Sidebar

Install

npm i prefetchit

Weekly Downloads

1

Version

0.2.1

License

MIT

Unpacked Size

13.4 kB

Total Files

9

Last publish

Collaborators

  • rafamel