Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A node.js module to resize, crop and upload images to Rackspace cloudfiles and Amazon S3
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A Node.js module to easily resize, crop and upload images to Rackspace cloudfiles. Possible to add different versions of the same file in cropped or resized variant.


$ npm install imager


You need to create imager configuration file with image variants and your storages

Checkout the example config file imager-example.json in the repo

var Imager = require('imager');
var imager = new Imager({storage : "rs", config_file: "path/to/imager_config.json"})

Uploading file(s)

The callback recieves an err object, a files array (containing the names of the files which were uploaded) and the cdnUri.

So if you have a variant, say thumb, then you can access the image by cdnUri+'/'+'thumb_'+files[0]. This would be the complete url of the image

  1. Form upload

    imager.upload(req, function(err, files, cdnUri){
        // do your stuff
    }, 'projects')
  2. Upload files from disk

    You can upload a single file or multiple files by providing the paths to all the files in an array

    Upload Single file from disk:

    imager.upload('path/to/file.jpg', function(err, files, cdnUri){
        // do your stuff
    }, 'projects')

    Upload multiple files from disk:

    var files = ['file1.jpg', 'file2.jpg']
    imager.upload(files, function(err, files, cdnUri){
        // do your stuff
    }, 'projects')
  3. Upload files from remote url

    imager.uploadRemoteImage('', function(err, files, cdnUri){
        // do your stuff
    }, 'projects')

Removing file(s)

  1. Remove a single file

    imager.remove('1330838831049.png', function (err) {
        // do your stuff
    }, 'projects')
  2. Remove multiple files

    var files = ['1330838831049.png', '1330838831049.png']
    imager.remove(files, function (err) {
        // do your stuff
    }, 'projects')


  • Support amazon storage
  • Support filesystem storage
  • Remove using of eval
  • Add functionality to remove files
  • Write tests
Something went wrong with that request. Please try again.