1.1.6 • Published 7 years ago
satay v1.1.6
satay
A utility for uploading static sites to AWS S3.
Usage
Using the CLI
Install
satayglobally:$ npm install -g satayCreate a configuration file:
satay.config.jsmodule.exports = { bucket: 'jameslnewell.me', groups: [ { source: './static', include: /\.html$/ }, //cache finger-printed assets for up to 1 year { source: './static', exclude: /\.html$/, params: { CacheControl: `max-age=${60 * 60 * 24 * 365.25}, public` } } ] };Configure your AWS credentials
Run
satay$ satay
Using the API
Install
sataylocally:$ npm install --save-dev satayCreate a script file:
upload.jsconst satay = require('satay'); satay('jameslnewell.me', [ { source: './static', include: /\.html$/ }, //cache finger-printed assets for up to 1 year { source: './static', exclude: /\.html$/, params: { CacheControl: `max-age=${60 * 60 * 24 * 365.25}, public` } } ]);Configure your AWS credentials
Run
upload.js$ node upload.js
CLI
$ satay --config=satay.config.js --force-uploadFlags:
--config- Optional. The configuration file name. Defaults tosatay.config.jsin the current working directory.
Configuration
Properties:
bucket- Optional. Astring. The name of the bucket.groups- Required. Anarrayof file groupings.source- Optional. Astring. The directory that will be searched. Defaults toprocess.cwd().include- Optional. ARegExporfunction. A regular expression or function to filter which files are included.exclude- Optional. ARegExporfunction. A regular expression or function to filter which files are excluded.prefix- Optional. Astring. The prefix that will be prepended to the object key. Defaults to"".params- Optional. Anobject. The additional parameters to pass toS3.putObject(). Defaults to{ContentType: mime.lookup(filename), ACL: 'public-read'}.
policy- Optional. Anobject. The AWS policy. Defaults to public read access for all files.website- Optional. Anobject. The AWS website configuration. Usesindex.htmlas the defaultIndexDocumentand404.htmlas the defaultErrorDocument.
API
satay(bucket: String, groups: Array<Group>, options: Object): PromiseParameters:
bucket- Optional. Astring. The name of the bucket.groups- Required. Anarrayof file groupings.source- Optional. Astring. The directory that will be searched. Defaults toprocess.cwd().include- Optional. ARegExporfunction. A regular expression or function to filter which files are included.exclude- Optional. ARegExporfunction. A regular expression or function to filter which files are excluded.prefix- Optional. Astring. The prefix that will be prepended to the object key. Defaults to"".params- Optional. Anobject. The additional parameters to pass toS3.putObject(). Defaults to{ContentType: mime.lookup(filename), ACL: 'public-read'}.
options- Optional. Anobject. Additional options.policy- Optional. Anobject. The AWS policy. Defaults to public read access for all files.website- Optional. Anobject. The AWS website configuration. Usesindex.htmlas the defaultIndexDocumentand404.htmlas the defaultErrorDocument.
Change log
2.0.0-preview.6
7 years ago
2.0.0-preview.5
7 years ago
2.0.0-preview.4
7 years ago
2.0.0-preview.3
7 years ago
2.0.0-preview.2
7 years ago
2.0.0-preview.1
7 years ago
1.1.6
8 years ago
1.1.5
8 years ago
1.1.4
8 years ago
1.1.3
8 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago