1.0.1 • Published 7 years ago

image-minify-nodejs-client v1.0.1

Weekly downloads
8
License
-
Repository
github
Last release
7 years ago

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_host', api_host: 'api_key'});

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