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

aeris-s3-sync

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aeris-s3-sync

Node.js wrapper around the AWS CLI S3 sync utility

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

s3-sync

Node.js wrapper around the AWS CLI S3 sync command

Why would I use this instead of node-s3-client?

In order to compare files, node-s3-client attempts to reimplement the hashing algorithm used by the AWS API in creating an s3 object's etag. My experience is that is doesn't always work (especially with large files).

This library uses the AWS CLI tool, which -- though it also re-implements the hashing algorithm -- it at least supported by the same team which created the algorithm.

s3-sync also:

  • Locks download paths, meaning it will not allow you to download an object from s3 to the same local file path.
  • Resolves with a list of downloaded files paths

Usage

const s3Client = S3Client({
  accessKeyId: 'testId',
  secretAccessKey: 'testKey',
  region: 'testRegion'
});

s3Client.sync('s3://my-bucket/foo/bar', '/local/foo/bar', {
  // set to `true` to enable the --delete flag
  delete: false,
  // Accepts a stream.Writable, to which the `s3 sync` stdout will be piped
  stdout: process.stdout
  // Accepts a stream.Writable, to which the `s3 sync` stderr will be piped
  stdout: process.stdout
})
  .then(res => {
    // res.stdout is the stdout from the `s3 sync` command
    // res.stderr is the stderr from the `s3 sync` command
    // res.files is an array of downloaded file paths
  })

s3Client.sync also accepts error-first callbacks, for example:

s3Client.sync(from, to, opts, (err, res) => {
    // res.stdout is the stdout from the `s3 sync` command
    // res.stderr is the stderr from the `s3 sync` command
    // res.files is an array of downloaded file paths
});

Keywords

FAQs

Package last updated on 07 Feb 2017

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