Minimalist node.js/io.js CLI & programmatic stream-based interface for Cloudimage.io
Installation
For command-line usage, install it as global package:
npm install -g cloudimage
For programmatic usage, install it in the tree dependency:
npm install cloudimage --save[-dev]
CLI
$ cloudimage --help
Usage: cloudimage [options] [command] Commands: crop [options] [url] Crop any image to a given square thumbnail in pixels width [options] [imageUrl] Resize any image to a given width in pixels height [options] [imageUrl] Resize the image to the given height in pixels resizei [options] [imageUrl] The image will be resized to fit the given resolution box . White will be added
API
clouimage(imageUrl)
Constructor of the Cloudimage client
var fs = var Cloudimage = var imageUrl = 'http://bit.ly/1Cqb78Z'
Use a custom Cloudimage's customer ID:
CloudimageclientID = 'svrd10'
cloudimage#crop(resolution)
Crop any image to a given square thumbnail in pixels. Example: 300x300
cloudimage#width(resolution)
Resize any image to a given width in pixels. Example: '200'
cloudimage#height(resolution)
Resize any image to a given height in pixels. Example: '200'
cloudimage#resizeInBox(resolution)
The image will be resized to fit the given resolution box (but not cropped). White will be added for the padding, if needed.
Example: 300x200
cloudimage#resizeNP(resolution)
The image will be resized to fit the given resolution box (but not cropped). No padding will be added here.
Example: 300x200
cloudimage#cdn()
Cache any image in our worldwide CDN, without any modification of the image. This will increase the response time in future requests
cloudimage.VERSION
Get the current module version
License
MIT © Tomas Aparicio