baidubce-cli
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "baidubce-cli", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "baidu cloud engine command line tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,6 +52,10 @@ ## baidubce-cli | ||
baidubce bos --put-superfile cute-kitty.avi bos://my-bucket-1/ | ||
[=== ] 27% | ||
``` | ||
> Btw, upload a large file you'll get a progress bar notification. | ||
## Others | ||
More usages please refer `baidubce bos -h`. Feedback is welcome, feel free to send me an email for any question. |
@@ -36,2 +36,7 @@ /** | ||
var left_size = fs.statSync(filename).size; | ||
var min_part_size = 5 * 1024 * 1024; | ||
var part_count = Math.ceil(left_size / min_part_size); | ||
var success_count = 0; | ||
var offset = 0; | ||
@@ -43,6 +48,10 @@ var part_number = 1; | ||
while (left_size > 0) { | ||
var part_size = Math.min(left_size, 5 * 1024 * 1024); | ||
var part_size = Math.min(left_size, min_part_size); | ||
defers.push(client.uploadPartFromFile(bucket_name, key, upload_id, | ||
part_number, part_size, filename, offset)); | ||
part_number, part_size, filename, offset).then(function(response) { | ||
success_count += 1; | ||
require('./util').displayProgress(Math.floor(success_count * 100 / part_count)); | ||
return response; | ||
})); | ||
@@ -57,2 +66,3 @@ left_size -= part_size; | ||
.then(function(all_response) { | ||
console.log(); | ||
var part_list = []; | ||
@@ -59,0 +69,0 @@ u.each(all_response, function(response, index) { |
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
19987
8
482
60