# aeris-s3-sync

> Node.js wrapper around the AWS CLI S3 sync utility

Latest version **1.0.1** (published 2017-02-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install aeris-s3-sync
pnpm add aeris-s3-sync
yarn add aeris-s3-sync
bun add aeris-s3-sync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-02-07 |
| First published | 2016-01-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Edan Schwartz |
| Maintainers | eschwartz |
| Keywords | aws, s3, sync |

## Links

- npm: https://www.npmjs.com/package/aeris-s3-sync
- Repository: https://github.com/eschwartz/s3-sync
- Homepage: https://github.com/eschwartz/s3-sync#readme
- Issues: https://github.com/eschwartz/s3-sync/issues
- npm.io page: https://npm.io/package/aeris-s3-sync

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^3.10.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-02-07
- 1.0.0 — 2016-01-08

## README

s3-sync
=========
Node.js wrapper around [the AWS CLI S3 sync command](http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html)

**Why would I use this instead of [node-s3-client](https://github.com/andrewrk/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

```js
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:

```js
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
});
```

---
_Source: https://npm.io/package/aeris-s3-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
