image-file-optimizer

1.0.3 • Public • Published

image-file-optimizer

With this Node module you can easily optimize image files, It accepts JSON format data & converts to form data and process request for optimization.

Installation

  • Just include image-file-optimizer before your scripts.
  • npm install image-file-optimizer if you’re using node.js.

Usage

const optimizer = require('image-file-optimizer');
const reqParam = {
        s3Path: 'provide your s3 path',
        lossy: true,
        webp: true,
        rename: false,
        resize: [
            {
                id: 'small',
                strategy: 'fit',
                width: 100,
                height: 100
            },
            {
                id: 'medium',
                strategy: 'crop',
                width: 300,
                height: 300
            },
            {
                id: 'large',
                strategy: 'square',
                size: 400
            }
        ],
        files: files // file-object
    };
const optimizedRes = optimizer(reqParam).then(response => {
        console.log('Final Optimized Response ', response);
});

Readme

Keywords

none

Package Sidebar

Install

npm i image-file-optimizer

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

2.83 kB

Total Files

3

Last publish

Collaborators

  • ravi.dwivedi