Proxy server for image optimization on Node.JS use (fastify, axios, sharp) Automatic recognition of browser support formats WebP
yarn add node-imgoptimize
git clone https://github.com/AntonLukichev/node-imgoptimize.git
yarn install
npm install node-imgoptimize --save
git clone https://github.com/AntonLukichev/node-imgoptimize.git
npm install
Requires node >= 8.0, but I recommended use >= 10.0 LTS
example https://node-imgoptimize.herokuapp.com/
$ git clone https://github.com/AntonLukichev/node-imgoptimize.git
$ cd ./node-imgoptimize
$ docker build -t node-imgoptimize .
$ docker run -it --rm -p 3000:3000 -e NODE_ENV=production node-imgoptimize
$ git clone https://github.com/AntonLukichev/node-imgoptimize.git
$ cd ./node-imgoptimize
$ docker-compose build
$ docker-compose up
see tips for Docker
{url}?w=500&q=80
support parameters (after "?"):
w - image width;
h - image height;
q - image quality, 80 recommended for JPEG and WebP;
fm - image format, list in config.js and default jpeg or webp (if browser supports it);
Edit defaults config for you need (automatically created after the first run)
./config/config.js
./config/server.js
v0.2.0:
v0.3.0:
v0.4.0:
v0.5.0:
v1.0.0:
I plan to implement in the future:
If you'd like to lazy load images, I recommend using lazysizes.
Simple copy your favicon.ico file in root directory project
Production Best Practices: Security
See the CONTRIBUTING file here
Copyright (c) Anton Lukichev
Version | Tag | Published |
---|---|---|
0.4.5 | latest | 2yrs ago |