Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Sep 20, 2014
1 parent b4c2efe commit b6447d0
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ A node module to resize, crop and upload images (with different variants and pre
$ npm install imager
```

## API
## Config

### config
### variants

```js
exports.variants = {
Expand Down Expand Up @@ -73,6 +73,43 @@ In the above config, item and gallery are variants. thumb and large are presets.
```
- `original` - A true value. If this option is set, the original image will be uploaded without any image processing.
### storages
```js
exports.storages = {
local: {
provider: 'local',
path: '/tmp',
mode: 0777
},
rackspace: {
provider: 'rackspace',
username: process.env.IMAGER_RACKSPACE_USERNAME,
apiKey: process.env.IMAGER_RACKSPACE_KEY,
authUrl: 'https://lon.auth.api.rackspacecloud.com',
region: 'IAD', // https://github.com/pkgcloud/pkgcloud/issues/276
container: process.env.IMAGER_RACKSPACE_CONTAINER
},
amazon: {
provider: 'amazon',
key: process.env.IMAGER_S3_KEY,
keyId: process.env.IMAGER_S3_KEYID,
container: process.env.IMAGER_S3_BUCKET
}
}
```
## Usage
```js
var imager = new Imager(variants.item, storages.amazon);
// You can also pass only the storage without a variant which will upload the
// original image
// new Imager(storages.amazon)
```
## API
### .upload(files, callback)
`files` is an array of files or a single file. A file can be a file object, absolute file path pointing a local file or base64 encoded image data. `callback` accepts `err` and an object containing the array of uploaded images.
Expand Down

0 comments on commit b6447d0

Please sign in to comment.