utropicmedia / storj-nodejs

nodejs bindings for libuplink
20 stars 2 forks source link

Best Practices #8

Open hunterInt opened 4 years ago

hunterInt commented 4 years ago

Hello, This isn't a bug report, but I have some questions on what are the best practices for this library:

  1. Currently uploading and downloading files is very fast, however, half the time is spent on opening and closing the project. Is it a best practice, or even required, to run parse_accessc, request_access_with_passphrasec and open_project each time before uploading or downloading a file? Or can these be set once and saved in memory for later use?
  2. In the example file, there are a number of options being set:
    new storj.ListBucketsOptions();
    new storj.UploadOptions();
    new storj.ListObjectsOptions();
    new storj.DownloadOptions();

I haven't found any documentation to what options should be set and what they mean. Can I get some clarification on this? :) Thanks!

shivam201312 commented 4 years ago

@hunterInt , you can run these function only once( parse_accessc , requesting_access_with_passphrasec and open_project) and use open_project result to perform any operation related to bucket or object .

kaloyan-raev commented 4 years ago

I haven't found any documentation to what options should be set and what they mean. Can I get some clarification on this? :) Thanks!

@hunterInt The API in the Go library is best documented at the moment. You can look up there how the options are described: https://pkg.go.dev/storj.io/uplink?tab=doc We will make sure to copy this documentation to the other language bindings too.