Package Exports
- optimize-images
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (optimize-images) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Optimize Images
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)