JSPM

shrink-img

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q23817F
  • License MIT

Reduce image size using tinify module.

Package Exports

  • shrink-img

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 (shrink-img) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

shrink-img

NPM version Dependency Status devDependency Status License

Installation

    npm install shrink-img

Usage

    const shrink = require('shrink-img');

    // Pass in a directory. It will recursively compress all png,jpg,gif images under this folder.
    // !! This will replace your original images, do back up if you needed.
    shrink('FolderPath', 'yourTinyPngAPIKey');
    shrink('.', 'ZgPDOUKtFZgPIiDOKtR');

You need to have a tinyPng API key before compress images. Go to apply: https://tinypng.com/developers