text: var auditShrinkWrap = require('nsp-audit-shrinkwrap');
  var auditPackage = require('nsp-audit-package');
  var nspPrettyOutput = require('./lib/prettyOutput');
  var gutil = require('gulp-util');
  var auditor;
  
  function nspGulp(parameters, cb) {
      if (typeof parameters === 'string') {
          var path = parameters;
          parameters = {};
          parameters.path = path;
      }
  
      if (parameters.path.indexOf('package') > -1) {
          auditor = auditPackage;
      } else if (parameters.path.indexOf('shrinkwrap') > -1) {
          auditor = auditShrinkWrap.auditByPath;
      } else {
          return cb({
              stack: 'You need to specify the correct path to either your ' +
                     'package.json or shrinkwrap.json in relation to your ' +
                     'gulpfile.',
              message: 'Please Specify Valid Path'
          });
      }
  
      auditor(parameters.path, function(err, results) {
          var ret;
  
          if (err) {
              ret = cb(err);
          } else {
              if (results.length > 0) {
                  var stack = '\n' + nspPrettyOutput(results);
  
                  if (parameters.stopOnError === false) {
                      gutil.log(stack);
                      ret = cb();
                  } else {
                      ret = cb({
                          stack: stack,
                          message: 'Vulnerabilities Found'
                      });
                  }
              } else {
                  ret = cb();
              }
          }
  
          return ret;
      });
  }
  
  module.exports = nspGulp;
  