<commit_before># Using external config file
## bonus: keeping those tasks DRY

`config.json`

```json
{
  "desktop" : {
    "src" : [
      "dev/desktop/js/**/*.js",
      "!dev/desktop/js/vendor/**"
    ],
    "dest" : "build/desktop/js"
  },
  "mobile" : {
    "src" : [
      "dev/mobile/js/**/*.js",
      "!dev/mobile/js/vendor/**"
    ],
    "dest" : "build/mobile/js"
  }
}
```

`gulpfile.js`

```js
// npm install gulp gulp-uglify
var gulp   = require('gulp');
var uglify = require('gulp-uglify');
var config = require('./config.json');

function doStuff(cfg) {
  return gulp.src(cfg.src)
    .pipe(uglify())
    .pipe(gulp.dest(cfg.dest));
}

gulp.task('dry', function () {
  doStuff(config.desktop);
  doStuff(config.mobile);
});
```
<commit_msg>added info about sharing config file<commit_after># Using external config file
## bonus: keeping those tasks DRY

`config.json`

```json
{
  "desktop" : {
    "src" : [
      "dev/desktop/js/**/*.js",
      "!dev/desktop/js/vendor/**"
    ],
    "dest" : "build/desktop/js"
  },
  "mobile" : {
    "src" : [
      "dev/mobile/js/**/*.js",
      "!dev/mobile/js/vendor/**"
    ],
    "dest" : "build/mobile/js"
  }
}
```

`gulpfile.js`

```js
// npm install gulp gulp-uglify
var gulp   = require('gulp');
var uglify = require('gulp-uglify');
var config = require('./config.json');

function doStuff(cfg) {
  return gulp.src(cfg.src)
    .pipe(uglify())
    .pipe(gulp.dest(cfg.dest));
}

gulp.task('dry', function () {
  doStuff(config.desktop);
  doStuff(config.mobile);
});
```

## bonus2: config.json can be used by another task runner, like `Grunt`

{'fraction_non_alphanumeric': 0.21455223880597016, 'fraction_numerical': 0.0006218905472636816, 'mean_word_length': 2.924390243902439, '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': '921466', 'n_tokens_mistral': 654, 'n_tokens_neox': 631, 'n_words': 114}