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

archive-stream-to-s3

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

archive-stream-to-s3

A stream for writing the contents of a tar file to AWS S3.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

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

A stream for writing the contents of a tar file to s3

Usage

With Writable

const { ArchiveStreamToS3 } = require("archive-stream-to-s3");
const gunzip = require("gunzip-maybe");

const toS3 = new ArchiveStreamToS3("my-bucket", "some/prefix/to/add", s3, [
  /.*foo.txt$/
]);

toS3.on("finish", () => {
  console.log("upload completed");
});

toS3.on("error", e => {
  console.error(e);
});

const archive = fs.createReadStream("archive.tgz");

//Note: if you have compressed archive you can decompress w/ gunzip-maybe.
archive.pipe(gunzip()).pipe(toS3);

With Promise

You can also use the promise function that has gunzip built in.

const { promise } = require("archive-stream-to-s3");

const archive = fs.createReadStream("archive.tgz");

promise("my-bucket", "prefix", s3, archive).then(result => {
  console.log(result); //=> { keys: [...]}
});

Contributing

Unit tests

npm run test

Integration tests

For integration tests to run you'll need to set the following env vars:

namepurpose
ARCHIVE_STREAM_TO_S3_TEST_BUCKETthe s3 bucket, this bucket is removed and recreated
ARCHIVE_STREAM_TO_S3_TEST_PREFIXthe prefix to use

You'll also need the aws-cli commands on your path.

Run

npm run it

Release

npm run release

Keywords

FAQs

Package last updated on 13 Jul 2018

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