# gulp-s3-publish

> A plugin for Gulp that uploads files to s3

Latest version **3.0.0** (published 2020-06-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2020-06-28 |
| First published | 2015-12-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 7 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Maintainers | adrianfalleiro |
| Keywords | gulp-plugin, gulp, s3 |

## Links

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

## Dependencies (7)

- [mime](https://npm.io/package/mime.md) ^2.4.6
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [through2](https://npm.io/package/through2.md) ^3.0.2
- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.3
- [ansi-colors](https://npm.io/package/ansi-colors.md) ^1.1.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1
- [through2-concurrent](https://npm.io/package/through2-concurrent.md) ^1.1.0

## Recent versions

- 3.0.0 (latest) — 2020-06-28
- 2.0.0 — 2017-05-08
- 1.0.2 — 2017-03-18
- 1.0.1 — 2015-12-07
- 1.0.0 — 2015-12-07

## README

# gulp-s3-publish [![NPM version][npm-image]][npm-url]

> s3 plugin for [gulp](https://github.com/gulpjs/gulp)

## Info
This plugin started as a fork of [gulp-s3](https://github.com/nkostelnik/gulp-s3).

Recently updated for Gulp 4 and added support for cleaning orphan files from an S3 bucket. Plugin API has changed since the 2.x release.

Please open an issue for feature requests.

## Usage

First, install `gulp-s3-publish` and `aws-sdk` as a development dependency:

```shell
npm install --save-dev gulp-s3-publish aws-sdk
```

Then, use it in your `Gulpfile.js`:
```javascript
const { upload, clean } = require('gulp-s3-publish');
const { S3 } = require('aws-sdk'); 

const client = S3();

const uploadOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path',
  // delay: 0,
  // maxConcurrency: 1,
  putObjectParams: {
    ACL: 'public-read'
  },
  // dryRun: false,
};

const cleanOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path'
  // whitelist: [
  //   { type: 'key', path: 'keep-this-file.txt' },
  //   { type: 'keyPrefix', path: 'keep-this-path' },
  // ],
  // dryRun: false,
};

// Upload files to S3
// and clean orphaned files
gulp.task('deploy', () => {
  return gulp.src('./dist/**/*')
    .pipe(upload(client, uploadOpts))
    .pipe(clean(client, cleanOpts))
});

```

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)

[npm-url]: https://npmjs.org/package/gulp-s3-publish
[npm-image]: https://badge.fury.io/js/gulp-s3-publish.png

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