npm install imgopImage-optimisation server powered by libvips
```
/example.jpg?w=1050&h=700
- libvipsiojs
-
- Retrieve images from an s3 bucket
- Cache downloaded images to the file system for subsequent renders using fs-lru-cache
- Resize and adjust image quality using parameters added to the querystring
- Use behind a CDN to cache resized images
Set the following environment variables:
``
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
IMGOP_BUCKET // bucket to retrieve images from
Install imgop and run it on your server:
`bash`
$ npm install -g imgop
$ imgop
The available options are:
`
Usage: imgop [options]
Options:
-h, --help output usage information
-V, --version output the version number
-p, --port
`
Alternatively, you can also require imgop as a module which returns a Function that creates a http.Server instance.
`js`
require('imgop')()
.listen(3000);
Modify an image by adding parameters to the querystring:
``
http://localhost:3000/example.jpg?w=1050&h=700&q=75&fit=crop&fm=png
Similar to imgix with only the following parameters supported.
Width.
Height.
Quality. Default is 80.
Fit mode. max or crop. Default is max.
Format. jpg, png or webp. Default is jpg`.