Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 573 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 573 Bytes

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
});