<commit_before>'use strict';

var gulp = require('gulp');
var clean = require('gulp-clean');
var eslint = require('gulp-eslint');
var rename = require('gulp-rename');
var uglify = require('gulp-uglifyjs');
var browserify = require('gulp-browserify');

gulp.task('clean', function() {
  gulp.src('./dist/*')
    .pipe(clean({
      read: false
    }));
});

gulp.task('js', function() {
  gulp.src('./browser.js')
    .pipe(browserify({
      read: false,
      standalone: 'Vault',
      debug: process.env.NODE_ENV === 'dev'
    }))
    .pipe(uglify())
    .pipe(rename('vault.min.js'))
    .pipe(gulp.dest('./dist'));
});

gulp.task('build', ['clean', 'js']);

gulp.task('eslint', function() {
  return gulp.src([
    './*.js',
    'lib/*.js'
  ])
    .pipe(eslint())
    .pipe(eslint.format())
    .on('data', function(file) {
      if (file.eslint.messages && file.eslint.messages.length) {
        gulp.fail = true;
      }
    }
  );
});

process.on('uncaughtException', function(err) {
  console.log(err);
  console.log('Stacktrace:');
  console.log(err.stack);
  process.exit(1);
});

process.on('exit', function() {
  if (gulp.fail) {
    process.exit(1);
  }
});<commit_msg>adding watch task<commit_after>'use strict';

var gulp = require('gulp');
var clean = require('gulp-clean');
var eslint = require('gulp-eslint');
var rename = require('gulp-rename');
var uglify = require('gulp-uglifyjs');
var browserify = require('gulp-browserify');

gulp.task('clean', function() {
  gulp.src('./dist/*')
    .pipe(clean({
      read: false
    }));
});

gulp.task('js', function() {
  gulp.src('./browser.js')
    .pipe(browserify({
      read: false,
      standalone: 'Vault',
      debug: process.env.NODE_ENV === 'dev'
    }))
    .pipe(uglify())
    .pipe(rename('vault.min.js'))
    .pipe(gulp.dest('./dist'));
});

gulp.task('build', ['clean', 'js']);

gulp.task('eslint', function() {
  return gulp.src([
    './*.js',
    'lib/*.js'
  ])
    .pipe(eslint())
    .pipe(eslint.format())
    .on('data', function(file) {
      if (file.eslint.messages && file.eslint.messages.length) {
        gulp.fail = true;
      }
    }
  );
});

gulp.task('watch', function() {
  gulp.watch([
    './lib/*.js'
  ], ['js']);
});

process.on('uncaughtException', function(err) {
  console.log(err);
  console.log('Stacktrace:');
  console.log(err.stack);
  process.exit(1);
});

process.on('exit', function() {
  if (gulp.fail) {
    process.exit(1);
  }
});
{'fraction_non_alphanumeric': 0.23177189409368634, 'fraction_numerical': 0.001629327902240326, 'mean_word_length': 3.1911262798634814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4761719', 'n_tokens_mistral': 918, 'n_tokens_neox': 920, 'n_words': 145}