1.1.1 • Published 9 years ago

img-cloud v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

img-cloud NPM version Build Status Coverage Status

A node client to easily upload to and retrieve from img-cloud server

Install

$ npm install --save img-cloud

Usage

Configuring your client

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 

Uploading an image

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"]
 * } 
 */

Getting an embeddable image tag

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">
 * /

License

MIT © Liftoff LLC

1.1.1

9 years ago

1.1.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago