oi

optimize-images

Middleware to optimize images via tinypng and serving optimized images

Showing:

Popularity

Downloads/wk

5

GitHub Stars

1

Maintenance

Last Commit

1mo ago

Contributors

0

Package

Dependencies

5

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Optimize Images

Github npm Build status Test coverage License

API

const optimizeImages = require('optimize-images')

optimizeImage(root, tinypngApiKey, [options])

Middleware optimizes the images from root directory, save them to disk and then serves the optimized images.

Example

const express = require('express')
const optimizeImages = require('optimize-images')

const app = express()

//generate from https://tinypng.com/developers
const tinypngApiKey = "YOUR_API_SECRET_KEY"
const root = "public"
const options = {
  dirName: "optimized-images" 
}

app.use(optimizeImages(root, tinypngApiKey, options)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100