Comparing version 0.1.0 to 0.2.0
@@ -0,0 +0,0 @@ |
@@ -12,3 +12,4 @@ | ||
var utils = require('./utils') | ||
var Emitter = require('events').EventEmitter | ||
, utils = require('./utils') | ||
, auth = require('./auth') | ||
@@ -37,3 +38,3 @@ , http = require('http') | ||
req.on('response', function(res){ fn(null, res); }); | ||
req.on('error', function(err){ fn(err); }); | ||
req.on('error', fn); | ||
} | ||
@@ -183,2 +184,5 @@ | ||
var self = this; | ||
var emitter = new Emitter; | ||
var written = 0; | ||
if ('function' == typeof headers) { | ||
@@ -197,5 +201,16 @@ fn = headers; | ||
var fileStream = fs.createReadStream(src); | ||
self.putStream(fileStream, filename, headers, fn); | ||
var stream = fs.createReadStream(src); | ||
self.putStream(stream, filename, headers, fn); | ||
stream.on('data', function(chunk){ | ||
written += chunk.length; | ||
emitter.emit('progress', { | ||
percent: written / stat.size * 100 | 0, | ||
total: stat.size, | ||
written: written | ||
}); | ||
}); | ||
}); | ||
return emitter; | ||
}; | ||
@@ -202,0 +217,0 @@ |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ |
@@ -0,0 +0,0 @@ (The MIT License) |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["aws", "amazon", "s3"], | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": "TJ Holowaychuk <tj@learnboost.com>", | ||
@@ -8,0 +8,0 @@ "contributors": [ |
@@ -0,0 +0,0 @@ # knox |
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
659
23466