lib/dep-validate.js
function gulp(opts) {
  opts = opts || {};

  var failOnError = opts['failOnError'] || false;
  var interimFiles = [];
  var failedValidations = [];

  return Through(
    function (file) {
      interimFiles.push(file.path);
      this.queue(file);
    },
    function () {
      var baseFile = opts.packageFile;

      interimFiles.forEach(function (file) {
        opts.packageFile = file;

        var results = validate(opts);

        if (hasErrors(results)) {
          failedValidations.push(file);
          log(results);
        }
      });

      opts.packageFile = baseFile;

      if (failOnError &&  failedValidations.length) {
        this.emit('error', new PluginError('dep-validate', 'Unable to validate dependencies'));
      } else {
        this.emit('end');
      }
    }
  );
}
function gulp(opts) {
  opts = opts || {};

  var failOnError = opts['failOnError'] || false;
  var interimFiles = [];
  var failedValidations = [];

  return Through(
    function (file) {
      interimFiles.push(file.path);
      this.queue(file);
    },
    function () {
      var baseFile = opts.packageFile;

      interimFiles.forEach(function (file) {
        opts.packageFile = file;

        var results = validate(opts);

        if (hasErrors(results)) {
          failedValidations.push(file);
          log(results);
        }
      });

      opts.packageFile = baseFile;

      if (failOnError &&  failedValidations.length) {
        this.emit('error', new PluginError('dep-validate', 'Unable to validate dependencies'));
      } else {
        this.emit('end');
      }
    }
  );
}
function gulp ( opts ) { opts = opts || { } ; var failOnError = opts [ 'failOnError' ] || false ; var interimFiles = [ ] ; var failedValidations = [ ] ; return Through ( function ( file ) { interimFiles . push ( file . path ) ; this . queue ( file ) ; } , function ( ) { var baseFile = opts . packageFile ; interimFiles . forEach ( function ( file ) { opts . packageFile = file ; var results = validate ( opts ) ; if ( hasErrors ( results ) ) { failedValidations . push ( file ) ; log ( results ) ; } } ) ; opts . packageFile = baseFile ; if ( failOnError && failedValidations . length ) { this . emit ( 'error' , new PluginError ( 'dep-validate' , 'Unable to validate dependencies' ) ) ; } else { this . emit ( 'end' ) ; } } ) ; }
Returns a Transform Stream for use with Gulp.

@param opts an options Object (see README.md).
@returns a Stream instance for Gulp use.
Returns a Transform Stream for use with Gulp .