snap-push
Deliver static website files to Amazon S3, Azure or GCP.
Last updated a month ago by loune .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install snap-push 
SYNC missed versions from official npm registry.

snap-push - Upload static website files to the cloud

Highlights

  • Upload with support for:
    • Amazon S3
    • Azure
    • Google Cloud Storage
    • MinIO
  • Automatically detect and set correct Content-Type for uploaded files.
  • Set custom Cache-Control.
  • Concurrent uploads.
  • Only upload changed files.
  • Remove files that were deleted locally.
  • Prioritise upload of new files first.

Installation

For Amazon S3

yarn add snap-push aws-sdk

or use npm

npm install snap-push aws-sdk

For Azure Storage

yarn add snap-push @azure/storage-blob

For Google Cloud Storage

yarn add snap-push @google-cloud/storage

Basic Usage

snap-push can be used as a command line utility or as a library. For example, to push all the files in the dist folder to the root of the example-bucket S3 bucket and make them public:

Command line

$ cd dist && ../node_modules/.bin/snap-push './**/*' s3://example-bucket --public

Library code

const AWS = require('aws-sdk');
const push = require('snap-push').default;
const s3FileProvider = require('snap-push/dist/s3').default;

const providerOptions = {
  bucket: 'example-bucket',
  region: 'ap-southeast-2',
};

(async () => {
  const result = await push({
    currentWorkingDirectory: 'dist',
    files: './**/*',
    makePublic: true,
    provider: s3FileProvider(providerOptions),
  });

  console.log(result);
})();

Current Tags

  • 3.0.0                                ...           latest (a month ago)

5 Versions

  • 3.0.0                                ...           a month ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |