publish assets to amazon s3
CoffeeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
src/lib
.gitignore
.npmignore
Makefile
README.md
package.json

README.md

aws-publisher

install

$ npm install aws-publisher

usage

aws-publisher let you upload files within a directory to your amazon s3 bucket.

  • it only uploads new or modified files to your bucket.
  • it sets a far expiry date and zip files

Coffee Script:

Publisher = require 'aws-publisher'

# create s3 publisher
# see https://github.com/LearnBoost/knox for options list
publisher = new Publisher bucket: 'name',  key: 'xx', secret: 'xx'

# define filter closure that will only select js, png, and css file
filter = (f, stat) -> stat.isDirectory() or /\.(js|png|css)$/.test f

# publish 'public' dir to root folder '' of the  bucket
publisher.publishDir {origin: 'public', dest: '', filter}, cb

JavaScript:

var Publisher = require('aws-publisher');

// create s3 publisher
// see https://github.com/LearnBoost/knox for options list
var publisher = new Publisher({bucket: 'name',  key: 'xx', secret: 'xx'});

// define filter closure that will only select js, png, and css file
function filter (f, stat) {
  return stat.isDirectory() || /\.(js|png|css)$/.test(f);
}

// publish 'public' dir to root folder '' of the  bucket
publisher.publishDir({origin: 'public', dest: '', filter: filter}, cb);