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

polos-s3-stream-upload

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polos-s3-stream-upload

A writable stream which uploads to Amazon S3 using the multipart file upload API.

  • 2.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

s3-stream-upload

Build Status Build Status

A writable stream which uploads to Amazon S3 using the multipart file upload API.

Inspired by s3-upload-stream.

Install

npm install s3-stream-upload

Usage

// index.js
var UploadStream = require("s3-stream-upload");
var S3 = require("aws-sdk").S3;
var fs = require("fs");

var key = "file.mp3";
var s3 = new S3();

fs.createReadStream(__dirname + "/file.mp3")
  .pipe(UploadStream(s3, { Bucket: "my-bucket", Key: key }))
  .on("error", function (err) {
    console.error(err);
  })
  .on("finish", function () {
    console.log("File uploaded!");
  });
$ AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar node index.js

See aws-sdk-js for other ways to configure you environment variables.

API

UploadStream(s3, s3Config, config)

Creates and returns a WritableStream for uploading to S3. Takes an S3 instance, and a s3Config object, which takes the same options as S3.createMultipartUpload. Additional, non-S3 config options may be set on config, listed below:

  • concurrent How many chunks can be sent to S3 concurrently. 1 by default.
Events
  • chunk-uploaded - Emitted when a MPU chunk has been uploaded to S3, with the number of chunks uploaded at this point.
  • All WritableStream events.
Properties

Testing

To run unit tests, run:

npm test

License

MIT License, Copyright (c) 2014 Jordan Santell

Keywords

FAQs

Package last updated on 05 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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