docs: function wiredep(opts) {
    opts = opts || {};
  
    var cwd = opts.cwd ? $.path.resolve(opts.cwd) : process.cwd();
  
    config = module.exports.config = helpers.createStore();
  
    config.set
      ('on-error', opts.onError || function(err) { throw new Error(err); })
      ('on-file-updated', opts.onFileUpdated || function() {})
      ('on-main-not-found', opts.onMainNotFound || function() {})
      ('on-path-injected', opts.onPathInjected || function() {});
  
    config.set
      ('bower.json', opts.bowerJson || JSON.parse($.fs.readFileSync($.path.join(cwd, './bower.json'))))
      ('bower-directory', opts.directory || findBowerDirectory(cwd))
      ('cwd', cwd)
      ('dependencies', opts.dependencies === false ? false : true)
      ('detectable-file-types', [])
      ('dev-dependencies', opts.devDependencies)
      ('exclude', Array.isArray(opts.exclude) ? opts.exclude : [ opts.exclude ])
      ('file-types', mergeFileTypesWithDefaults(opts.fileTypes))
      ('global-dependencies', helpers.createStore())
      ('ignore-path', opts.ignorePath)
      ('include-self', opts.includeSelf)
      ('overrides', $._.extend({}, config.get('bower.json').overrides, opts.overrides))
      ('src', [])
      ('stream', opts.stream ? opts.stream : {});
  
    $._.map(config.get('file-types'), 'detect').
      forEach(function (fileType) {
        Object.keys(fileType).
          forEach(function (detectableFileType) {
            var detectableFileTypes = config.get('detectable-file-types');
  
            if (detectableFileTypes.indexOf(detectableFileType) === -1) {
              config.set('detectable-file-types', detectableFileTypes.concat(detectableFileType));
            }
          });
      });
  
    if (!opts.stream && opts.src) {
      (Array.isArray(opts.src) ? opts.src : [opts.src]).
        forEach(function (pattern) {
          config.set('src', config.get('src').concat($.glob.sync(pattern)));
        });
    }
  
    require('./lib/detect-dependencies')(config);
    require('./lib/inject-dependencies')(config);
  
    return config.get('stream').src ||
      Object.keys(config.get('global-dependencies-sorted')).
        reduce(function (acc, depType) {
          if (config.get('global-dependencies-sorted')[depType].length) {
            acc[depType] = config.get('global-dependencies-sorted')[depType];
          }
  
          return acc;
        }, { packages: config.get('global-dependencies').get() });
  }