@skgrush/sync-s3
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-rc.4 • Public • Published

@skgrush/sync-s3

Little tool for syncing files and metadata into an S3 bucket.

Expects that all files in the copySourceDirectory should replace all the files in the S3 bucket, and synchronizes them lazily based on MD5 hashes.

The main motivation for this project over AWS's official sync is I wanted to set metadata on specific files and the multi-sync approach made no sense to me.

Usage

env.json

{
  "$schema": "./dist/env.schema.json",
  "region": "us-east-2",
  "bucket": "BUCKET-NAME",
  "credentials": {
    "accessKeyId": "AWS-S3-WRITABLE-KEY-ID",
    "secretAccessKey": "AWS-S3-WRITABLE-ACCESS-KEY"
  },
  "copySourceDirectory": "../dist/MY-PROJECT-NAME/browser",
  "metadataFile": "../metadata.json"
}

metadata.json

{
  "some/file.jpeg": {
    "CacheControl": "no-cache"
  },
  "no-extension": {
    "ContentType": "application/javascript"
  },
  "go-elsewhere": {
    "WebsiteRedirectLocation": "https://github.com/skgrush"
  }
}
npx @skgrush/sync-s3 --execute env.json

Readme

Keywords

Package Sidebar

Install

npm i @skgrush/sync-s3

Weekly Downloads

11

Version

0.1.0-rc.4

License

MIT

Unpacked Size

29.4 kB

Total Files

18

Last publish

Collaborators

  • skgrush