0.1.0 • Published 6 years ago
prefetch-images v0.1.0
prefetch-images :flower_playing_cards:
Synchronously download images into the web browser cache on the client side.
Let users (&crawlers) wait first and experience fast impression of your brutalist :hearts: page without the lag.
:wavy_dash:
Example
import prefetchImages from "prefetch-images"
// ...code...
prefetchImages([
"https://media.giphy.com/media/sPuDbEFCsoN32/giphy.gif",
"https://media.giphy.com/media/3wDD0Khwova4o/giphy.gif"
]).then(() => {
document.location = "page2.html"
})
// ...code...
Nuxt.js
This plugin is currently an esm
module; you may need to add it to the transpile
build option in nuxt.config.js
.
Browser Support
Modern browsers, no IE! (no Babel)
Install
yarn add prefetch-images # npm install prefetch-images
CLI Commands
Command | Effect |
---|---|
yarn | Install dependencies |
yarn build | Create release build |
yarn test | Run tests manually (auto run before git push) |
TODO
- Handle timeouts (min/max excecuton time)
- Proper browser tests (and remove the current fake one)
- Make it SEO friendly somehow
- ?
License
MIT
:mushroom::herb:
0.1.0
6 years ago