A node client to easily upload to and retrieve from img-cloud server
$ npm install --save img-cloud
var imgCloud = require('img-cloud');
imgCloud.configure({apiKey: <YOUR_API_KEY>});
// Vist http://www.imgcloud.io to find out how to get your API key
var imgCloud = require('img-cloud');
imgCloud.configure({apiKey: <YOUR_API_KEY>});
imgCloud.upload(_dirName + '/uploads/my_img.jpg', {
folder: 'profile',
tags: 'user, profile'
});
/**
* The response looks like
* {
* "url": "http://www.imgcloud.io/ic_12345/1234567_my_img.jpg",
* "folder": "profile",
* "tags": ["user", "profile"]
* }
*/
var imgCloud = require('img-cloud');
imgCloud.configure({apiKey: <YOUR_API_KEY>});
imgCloud.transform('ic_12345/1234567_my_img.jpg', {
width: 150,
height: 150,
class: 'avatar',
alt: 'My Image',
title: 'My Image Title',
style: 'width: 150px',
crop: true,
scale: true,
grayscale: true,
borderColor: 'blue',
borderWidth: 1,
blur: 20,
sepia: true,
format: 'png'
});
/**
* This returns a string for a DOM element
* <img src="http://www.imgcloud.io/ic_12345/w_150,h_150/1234567_my_img.jpg" width="150" height="150">
* /
MIT © [Liftoff LLC]