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

s3

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3 - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

9

index.js

@@ -29,3 +29,4 @@ var knox = require('knox')

} else if (resp.statusCode === 200 || resp.statusCode === 307) {
uploader.emit('end', resp.req.url);
// sometimes resp.req is undefined. nobody knows why
uploader.emit('end', resp.req ? resp.req.url : resp.url);
} else {

@@ -74,4 +75,6 @@ uploader.emit('error', new Error("s3 http status code " + resp.statusCode));

removeListeners();
writeStream.end();
downloader.emit('end', { headers: headers });
// make sure the stream has ended before we emit the event
writeStream.end(null, null, function() {
downloader.emit('end', { headers: headers });
});
}

@@ -78,0 +81,0 @@ function onData(data) {

{
"name": "s3",
"version": "0.3.0",
"version": "0.3.1",
"description": "high level amazon s3 client using knox as a backend",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,2 +10,3 @@ Install:

var s3 = require('s3');
// createClient allows any options that knox does.

@@ -18,4 +19,10 @@ var client = s3.createClient({

// optional headers
var headers = {
'Content-Type' : 'image/jpg',
'x-amz-acl' : 'public-read'
};
// upload a file to s3
var uploader = client.upload("some/local/file", "some/remote/file");
var uploader = client.upload("some/local/file", "some/remote/file", headers);
uploader.on('error', function(err) {

@@ -56,1 +63,9 @@ console.error("unable to upload:", err.stack);

`S3_KEY=<valid_s3_key> S3_SECRET=<valid_s3_secret> S3_BUCKET=<valid_s3_bucket> npm test`
History:
--------
### 0.3.1
* fix `resp.req.url` sometimes not defined causing crash
* fix emitting `end` event before write completely finished
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