Socket
Socket
Sign inDemoInstall

gulp-s3-index

Package Overview
Dependencies
11
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-s3-index


Version published
Maintainers
1
Created

Readme

Source

gulp-s3-index Build Status

Updates the Website Index of a S3 Bucket

Purpose

Amazon S3 let's you use buckets as a Static Website Host. This allows you to visit your bucket as if it were a normal website. In the release process with gulp-awspublish and gulp-rev-all the index document has a hash. This plugin makes it possible to update the index document from your bucket, like gulp-cloudfront does it for cloudfront.

Under the Hood

This plugin will identify the index.html file based on the default or configured pattern. Once identified it will update the S3 bucket with the new index file.

Install

Install with npm

npm install --save-dev gulp-s3-index

Example

var gulp = require('gulp');
var revall = require('gulp-rev-all');
var awspublish = require('gulp-awspublish');
var s3_index = require("gulp-s3-index");

var aws = {
    "key": "AKIAI3Z7CUAFHG53DMJA",
    "secret": "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",
    "bucket": "bucket-name",
    "region": "us-standard"
};

var publisher = awspublish.create(aws);
var headers = {'Cache-Control': 'max-age=315360000, no-transform, public'};

gulp.task('default', function () {
    gulp.src('dist/**')
        .pipe(revall())
        .pipe(awspublish.gzip())
        .pipe(publisher.publish(headers))
        .pipe(publisher.cache())
        .pipe(awspublish.reporter())
        .pipe(s3_index(aws));
});

API

options.patternIndex

Type: Regular Expression Default: /^\/index\.[a-f0-9]{8}\.html(\.gz)*$/gi

Specify the pattern used to match the default index file


var aws = {
    ..,
    "patternIndex": /^\/root\-[a-f0-9]{4}\.html(\.gz)*$/gi
};

License

MIT

Keywords

FAQs

Last updated on 22 Jul 2015

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc