Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-awspublish

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-awspublish

A plugin for Gulp

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29K
decreased by-22.13%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-awspublish

NPM version Build Status Coverage Status Dependency Status

awspublish plugin for gulp

Usage

First, install gulp-awspublish as a development dependency:

npm install --save-dev gulp-awspublish

Then, add it to your gulpfile.js:

var es = require('event-stream'),
    awspublish = require('gulp-awspublish'),
    publisher = awspublish({ key: '...', secret: '...', bucket: '...'}),
    headers = { 'Cache-Control': 'max-age=315360000, no-transform, public' };

// publish all js files
// Cache-Control headers will be added on top of other headers
var js = gulp.src('./public/*.js')
  .pipe(publisher.publish(headers));

// gzip and publish all js files
// Content-Encoding headers will be added on top of other headers
var jsgz = gulp.src('./public/*.js')
  .pipe(awspublish.gzip())
  .pipe(publisher.publish(headers));

// sync content of s3 bucket with published files
// print progress with reportr
publisher
  .sync(es.merge(js, jsgz))
  .pipe(publisher.reporter());


API

awspublish.gzip()

create a gzip through stream, that gzip files and add Content-Encoding headers

awspublish.create(options)

Create a Publisher Options are passed to knox to create a s3 client

Publisher.publish(headers)

create a through stream, that push files to s3. Publish take a header hash as argument to override or add other s3 headers.

Files that get out of the stream get extra properties s3.path: s3 path of this file s3.state: publish state (add, update or skip) s3.headers: s3 headers for this file

Defaults headers are

  • x-amz-acl (default to public-read)
  • Content-Type
  • Content-Length
Publisher.sync(stream)

Take a stream of files and sync the content of the s3 bucket with these files. It return a readable stream with both input files and deleted files deleted file will have s3.state set to delete

awspublish.reporter()

create a reporter that logs to console each file state (delete, add, update, skip) and s3 path

License

MIT License

Keywords

FAQs

Package last updated on 03 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc