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

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

## Info
This plugin is a fork of [gulp-s3](https://github.com/nkostelnik/gulp-s3), which was unmaintained when this repository was forked.

This plugin adds support for AWS Signature V4 (which is mandatory for the newer regions), produces Streams2/3 compatible streams and will also error on upload failure, which can be useful in CI/CD environments

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

```<commit_msg>Remove leading slash from options example<commit_after># gulp-s3-publish [![NPM version][npm-image]][npm-url]

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

## Info
This plugin is a fork of [gulp-s3](https://github.com/nkostelnik/gulp-s3), which was unmaintained when this repository was forked.

This plugin adds support for AWS Signature V4 (which is mandatory for the newer regions), produces Streams2/3 compatible streams and will also error on upload failure, which can be useful in CI/CD environments

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

```
{'fraction_non_alphanumeric': 0.1665542818610924, 'fraction_numerical': 0.012811867835468645, 'mean_word_length': 3.5228658536585367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '152479', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1035, 'n_words': 293}