blitline-s3
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -82,3 +82,3 @@ 'use strict'; | ||
exports.default = function (config) { | ||
exports.default = function (config, jobOptions) { | ||
var APPLICATION_ID = config.APPLICATION_ID; | ||
@@ -129,8 +129,9 @@ var BUCKET = config.BUCKET; | ||
return function (src, functions) { | ||
_simple_blitline_node2.default.addJob({ | ||
application_id: APPLICATION_ID, | ||
return function (src, functions, options) { | ||
_simple_blitline_node2.default.addJob(_extends({}, jobOptions, { | ||
application_id: APPLICATION_ID | ||
}, options, { | ||
src: src, | ||
functions: functions.map(configFunction) | ||
}); | ||
})); | ||
@@ -137,0 +138,0 @@ return _simple_blitline_node2.default.postJobs().then(pollFromJobResponse).then(formatPollingResponse); |
{ | ||
"name": "blitline-s3", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Post Blitline jobs that uploads to s3 and do polling for the jobs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
# blitline-s3 | ||
Post Blitline jobs that uploads to s3 and do polling for the jobs. | ||
### Install | ||
``` | ||
npm install --save blitline-s3 | ||
``` | ||
### Usage | ||
```javascript | ||
// Require and configure Blitline | ||
var blitline = require('blitline-s3')({ | ||
APPLICATION_ID: 'APP_ID', // Your Blitline Application ID | ||
BUCKET: 'YourS3Bucket', // Your Amazon S3 Bucket Name | ||
NAME_PREFIX: 'uploads/' // Prefix for New Images Created By Blitline | ||
}); | ||
// Send a job to Blitline | ||
blitline('http://www.source.to/your-image.jpg', [{ | ||
name: 'resize', | ||
params: { | ||
width: 10, | ||
height: 10 | ||
}, | ||
save: 'your-image-resized.jpg' // Shortcut | ||
}, {...}]).then(function(response) { | ||
console.log(response); | ||
/* | ||
{ | ||
jobId: 'blitline_job_id', | ||
originalMeta: { | ||
width: 100, | ||
height: 100 | ||
}, | ||
images: [{ | ||
url: 'http://YourS3Bucket.s3.amazonaws.com/uploads/your-image-resized.jpg', | ||
meta: { | ||
width: 10, | ||
height: 10 | ||
} | ||
}, {...}] | ||
} | ||
*/ | ||
}, function(error) { | ||
console.error(error); | ||
}); | ||
``` | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6503
113
49