Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var Delete = require('./lib/delete');
* @param {object} [options] - options to provide to the readable stream
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @returns {object} a readable stream of line-delimited keys
* @example
* require('s3scan').List('s3://my-bucket/my-key')
Expand All @@ -28,6 +29,7 @@ module.exports.List = List;
* @param {object} [options] - options to provide to the transform stream
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @param {boolean} [options.passErrors] - if `true`, any error objects encountered
* will be passed into the readable stream
* @param {boolean} [options.keys] - if `true`, `.RequestParameters` (bucket and key)
Expand All @@ -54,6 +56,7 @@ module.exports.Get = Get;
* @param {object} [options] - options to provide to the writable stream
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @param {number} [options.concurrency] - concurrency at which to delete objects
* @returns {object} a writable stream
* @example
Expand All @@ -71,6 +74,7 @@ module.exports.Delete = Delete;
* @param {object} [options] - configuration options
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @param {number} [options.concurrency] - concurrency at which to request objects
* @param {boolean} [options.passErrors] - if `true`, any error objects encountered
* will be passed into the readable stream
Expand Down Expand Up @@ -105,6 +109,7 @@ module.exports.Scan = function(s3url, options) {
* @param {object} [options] - configuration options
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @param {number} [options.concurrency] - concurrency at which to delete objects
* @param {function} [callback] - a function to run on error or on completion of deletes
* @returns {object} a writable stream
Expand Down Expand Up @@ -151,6 +156,7 @@ module.exports.Purge = function(s3url, options, callback) {
* @param {object} [options] - options to provide to the writable stream.
* @param {object} [options.agent] - an HTTPS agent to use for S3 requests
* @param {object} [options.s3] - an S3 client to use to make requests
* @param {object} [options.region] - specify S3 region
* @param {number} [options.concurrency] - concurrency at which to copy objects
* @returns {object} a writable stream
*/
Expand Down
2 changes: 2 additions & 0 deletions lib/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module.exports = function(fromBucket, toBucket, keyTransform, options) {
};
if (options.logger) s3config.logger = options.logger;
if (options.agent) s3config.httpOptions.agent = options.agent;
if (options.region) s3config.region = options.region;

var s3 = options.s3 || new AWS.S3(s3config);

function write(key, enc, callback) {
Expand Down
2 changes: 2 additions & 0 deletions lib/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = function(bucket, options) {
};
if (options.logger) s3config.logger = options.logger;
if (options.agent) s3config.httpOptions.agent = options.agent;
if (options.region) s3config.region = options.region;

var s3 = options.s3 || new AWS.S3(s3config);

function write(key, enc, callback) {
Expand Down
2 changes: 2 additions & 0 deletions lib/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = function(bucket, options) {
};
if (options.logger) s3config.logger = options.logger;
if (options.agent) s3config.httpOptions.agent = options.agent;
if (options.region) s3config.region = options.region;

var s3 = options.s3 || new AWS.S3(s3config);

function transform(key, enc, callback) {
Expand Down
1 change: 1 addition & 0 deletions lib/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = function(s3url, options) {
};
if (options.logger) s3config.logger = options.logger;
if (options.agent) s3config.httpOptions.agent = options.agent;
if (options.region) s3config.region = options.region;
var s3 = options.s3 || new AWS.S3(s3config);

s3url = s3urls.fromUrl(s3url);
Expand Down