function browserslist (queries, opts) {
  if (typeof opts === 'undefined') opts = { }

  if (!opts.hasOwnProperty('path')) {
    opts.path = path.resolve ? path.resolve('.') : '.'
  }

  if (typeof queries === 'undefined' || queries === null) {
    if (env.BROWSERSLIST) {
      queries = env.BROWSERSLIST
    } else if (opts.config || env.BROWSERSLIST_CONFIG) {
      var file = opts.config || env.BROWSERSLIST_CONFIG
      if (path.basename(file) === 'package.json') {
        queries = pickEnv(parsePackage(file), opts)
      } else {
        queries = pickEnv(browserslist.readConfig(file), opts)
      }
    } else if (opts.path) {
      queries = pickEnv(browserslist.findConfig(opts.path), opts)
    }
  }

  if (typeof queries === 'undefined' || queries === null) {
    queries = browserslist.defaults
  }

  if (typeof queries === 'string') {
    queries = queries.split(/,\s*/)
  }

  if (!Array.isArray(queries)) {
    throw new BrowserslistError(
      'Browser queries must be an array. Got ' + typeof queries + '.')
  }

  var context = { dangerousExtend: opts.dangerousExtend }

  var stats = getStat(opts)
  if (stats) {
    if (typeof stats === 'string') {
      try {
        stats = JSON.parse(fs.readFileSync(stats))
      } catch (e) {
        throw new BrowserslistError('Can\'t read ' + stats)
      }
    }
    if ('dataByBrowser' in stats) {
      stats = stats.dataByBrowser
    }

    context.customUsage = { }
    for (var browser in stats) {
      fillUsage(context.customUsage, browser, stats[browser])
    }
  }

  var result = resolve(queries, context).map(function (i) {
    var parts = i.split(' ')
    var name = parts[0]
    var version = parts[1]
    if (version === '0') {
      return name + ' ' + byName(name).versions[0]
    } else {
      return i
    }
  }).sort(function (name1, name2) {
    name1 = name1.split(' ')
    name2 = name2.split(' ')
    if (name1[0] === name2[0]) {
      if (FLOAT_RANGE.test(name1[1]) && FLOAT_RANGE.test(name2[1])) {
        return parseFloat(name2[1]) - parseFloat(name1[1])
      } else {
        return compareStrings(name2[1], name1[1])
      }
    } else {
      return compareStrings(name1[0], name2[0])
    }
  })

  return uniq(result)
}
Return array of browsers by selection queries.

@param {(string|string[])} [queries=browserslist.defaults] Browser queries.
@param {object} opts Options.
@param {string} [opts.path="."] Path to processed file.
                                It will be used to find config files.
@param {string} [opts.env="development"] Processing environment.
                                         It will be used to take right
                                         queries from config file.
@param {string} [opts.config] Path to config file with queries.
@param {object} [opts.stats] Custom browser usage statistics
                             for "> 1% in my stats" query.
@return {string[]} Array with browser names in Can I Use.

@example
browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']