Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

baidubce-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baidubce-cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/bos/util.js

2

package.json
{
"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) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc