Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

event-lab/preload-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preload-images

NPM Version NPM Downloads MIT License Dependency Status

NPM

NPM

build preload images for events

installation

[sudo] npm install -g preload-images

usage

In your project folder, preload.

This will change your html files to:

<img src="some.jpg" data-preload> to <img src="some-small.jpg" data-preload="some.jpg" data-preload-origin="some.jpg">

And add a script <script data-preload=""> to the bottom of html body.

advanced usage

show helps

preload -h

or

preload --help

set image width

default width 160

preload -w 160

or

preload --width 160

set image quality

default quality 10

preload -q 10

or

preload --quality 10

specify html file

preload -f ./index.html

or

preload --file ./index.html

debug mode

preload -d

or

preload --debug

show version

preload -v

or

preload --version