imageresizer.io

1.1.1 • Public • Published

imageresizer.io

A wrapper around functions of https://imageresizer.io/

NPM

Install

$ npm install --save imageresizer.io

Initializing

var imageresizerModule = require('imageresizer.io')
 
imageresizerModule.init({
    key : 'YOU_API_KEY'
});

Usage

upload

//Puting one image to server, when getting the keyID, we are able to do processing
 
var url = 'http://www.w3schools.com/css/trolltunga.jpg'
 
imageresizerModule.upload(url).then(function(result){
    console.log(result);
},function(err){
    done(err);
})
 

resizeById

//Puting one image to server, when getting the keyID, we are able to do processing
 
// _id is responsed by request
// w,h,q
// or {f: 'png'}
var resizedUrl = imageresizerModule.resizeById(_id,{h:100});
 

resizeById

var url = 'http://www.w3schools.com/css/trolltunga.jpg'
 
imageresizerModule.uploadAndResize(url,{w:1000}).then(function(result){
    console.log(result);
},function(err){
    done(err);
})
 

License

MIT

Package Sidebar

Install

npm i imageresizer.io

Weekly Downloads

4

Version

1.1.1

License

ISC

Last publish

Collaborators

  • wahengchang