# gulp-s3-index

> > Updates the Website Index of a S3 Bucket

Latest version **0.0.2** (published 2015-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-s3-index
pnpm add gulp-s3-index
yarn add gulp-s3-index
bun add gulp-s3-index
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-07-22 |
| First published | 2015-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 11 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Michiel Westerbeek |
| Maintainers | happylinks |
| Keywords | gulpplugin, aws, s3 |

## Links

- npm: https://www.npmjs.com/package/gulp-s3-index
- Repository: https://github.com/happylinks/gulp-s3-index
- Issues: https://github.com/happylinks/gulp-s3-index/issues
- npm.io page: https://npm.io/package/gulp-s3-index

## Dependencies (11)

- [q](https://npm.io/package/q.md) ~1.0.1
- [glob](https://npm.io/package/glob.md) ~3.2.9
- [gulp](https://npm.io/package/gulp.md) ~3.5.5
- [mocha](https://npm.io/package/mocha.md) ~1.13.0
- [should](https://npm.io/package/should.md) *
- [aws-sdk](https://npm.io/package/aws-sdk.md) ~2.0.0-rc11
- [through2](https://npm.io/package/through2.md) ~0.4.0
- [gulp-util](https://npm.io/package/gulp-util.md) ~2.2.0
- [gulp-mocha](https://npm.io/package/gulp-mocha.md) ~0.4.1
- [gulp-jshint](https://npm.io/package/gulp-jshint.md) ~1.5.1
- [event-stream](https://npm.io/package/event-stream.md) ~3.1.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2015-07-22
- 0.0.1 — 2015-06-09

## README

# [gulp](https://github.com/wearefractal/gulp)-s3-index [![Build Status](https://travis-ci.org/happylinks/gulp-s3-index.png?branch=master)](https://travis-ci.org/happylinks/gulp-s3-index)

> 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](https://github.com/smysnk/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](https://npmjs.org)

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

## Example

```js
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));
});
```

  * See [gulp-awspublish](https://www.npmjs.org/package/gulp-awspublish), [gulp-rev-all](https://www.npmjs.org/package/gulp-rev-all)


## 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

```js

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

```


## License

[MIT](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/gulp-s3-index · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
