/image-minify-nodejs-client

Node.js client for ingowalther/image-minify-api

Primary LanguageJavaScriptApache License 2.0Apache-2.0

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