node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

optimize-images

Optimize Images

Github Build status Test coverage License

API

const optimizeImages = require('optimize-images')

optimizeImage(root, tinypngApiKey)

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"
 
app.use(optimizeImages(root, tinypngApiKey))