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

s3-download-stream

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

s3-download-stream - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

3

index.js

@@ -23,2 +23,5 @@ var Readable = require('stream').Readable;

this.done = false;
// allow for setting chunkSize = null so that default read amount kicks in
// otherwise, use an optimized chunksize for downloading
this.chunkSize = opts.chunkSize === undefined ? 1024*512 : opts.chunkSize;
this.concurrency = opts.concurrency || 6;

@@ -25,0 +28,0 @@ this.queue = new SimpleQueue(worker, processed, null, this.concurrency)

2

package.json

@@ -7,3 +7,3 @@ {

],
"version": "0.0.3",
"version": "0.0.4",
"repository": {

@@ -10,0 +10,0 @@ "type": "git",

@@ -44,2 +44,17 @@

## API
### var downloader = require('s3-download-stream')(config)
`config` options:
* `client`: [AWS.S3](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html) instance
* `concurrency`: (default `6`) Number of download workers.
* `chunkSize`: (default `512KB`) multiply this by concurrency to get rough MBps.
set to `null` to use chunk size chosen by downstream `read(n)` calls (usually `16KB`)
* `params`: See [AWS docs](http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property)
## License

@@ -46,0 +61,0 @@

@@ -8,2 +8,3 @@

apiVersion: "2006-03-01",
region: "",
secretAccessKey: process.env.S3_SECRET_KEY,

@@ -15,3 +16,4 @@ accessKeyId: process.env.S3_ACCESS_KEY

client: new aws.S3(auth),
concurrency: 6,
chunkSize: 1024*1024,
concurrency: 20,
params: {

@@ -23,2 +25,7 @@ Key: process.env.S3_KEY,

downloader(config).pipe(process.stdout)
var stream = downloader(config);
stream.pipe(process.stdout);
stream.on('error', function(err){
throw err;
});
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