Nanananananananana.. Pat Man!

    optimize-images

    1.2.0 • Public • Published

    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)

    Install

    npm i optimize-images

    DownloadsWeekly Downloads

    4

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    9.66 kB

    Total Files

    11

    Last publish

    Collaborators

    • futerzak