Check for duplicates in the stream and filter them or throw an error(evacuated from NSA/Microsoft Github)

Marat Abdullin efd9e149eb Merge pull request #2 from partizanos/patch-1 %!s(int64=8) %!d(string=hai) anos
test af8fd8909d Ability to print diffs for same files with different contents. %!s(int64=10) %!d(string=hai) anos
.gitignore 4edb6d96d7 Initial plugin version. %!s(int64=10) %!d(string=hai) anos
.travis.yml 4edb6d96d7 Initial plugin version. %!s(int64=10) %!d(string=hai) anos
LICENSE 32ffb82dc4 Initial commit %!s(int64=10) %!d(string=hai) anos
README.md b51959ec7f small addition in the generic plugin description %!s(int64=8) %!d(string=hai) anos
index.js af8fd8909d Ability to print diffs for same files with different contents. %!s(int64=10) %!d(string=hai) anos
package.json af8fd8909d Ability to print diffs for same files with different contents. %!s(int64=10) %!d(string=hai) anos

README.md

gulp-dedupe Build Status

This plugin is checking for duplicate files (based on their name) in the stream and filter them or throw an error.

Install:

npm install gulp-dedupe --save-dev

Example:

var dedupe = require('gulp-dedupe');

...
    .pipe(dedupe()) // Remove duplicates from previous tasks (if any).
    .pipe(concat('bundle.css')) // For example, we need to concat the result without duplicates.
    .pipe(gulp.dest('./build'));

dedupe(options) optionally accepts options object. The following options are available:

  • error to emit an error in case of duplicate (false by default).
  • same to emit an error in case duplicates have different contents (true by default).
  • diff to supply duplicates with different contents error from previous option with actual diff (false by default).