Skip to content

tomm1996/image-minify-nodejs-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-minify-nodejs-client

Promise-based nodejs client for image-minify-api

Setup

npm install image-minify-nodejs-client --save

Usage

// enter your api_key/api_host 
const imageMinfier = require('image-minify-nodejs-client')({api_key: 'api_key', api_host: 'api_host'});

let promise = imageMinfier.compress('/path/to/your/img');

promise.then((res) => {
	console.log(res.image);
	// log the compressed image as buffer
}, (err) => {
    console.log(err);
    // log the error message
});