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

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

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

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

    var context = { };

    var stats = getStat(opts);
    if ( stats ) {
        if ( typeof stats === 'string' ) {
            try {
                stats = JSON.parse(fs.readFileSync(stats));
            } catch (e) {
                error('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 = [];

    queries.forEach(function (selection) {
        if ( selection.trim() === '' ) return;

        var exclude = selection.indexOf('not ') === 0;
        if ( exclude ) selection = selection.slice(4);

        for ( var i in browserslist.queries ) {
            var type  = browserslist.queries[i];
            var match = selection.match(type.regexp);
            if ( match ) {
                var args = [context].concat(match.slice(1));
                var array = type.select.apply(browserslist, args);
                if ( exclude ) {
                    array = array.concat(array.map(function (j) {
                        return j.replace(/\s\d+/, ' 0');
                    }));
                    result = result.filter(function (j) {
                        return array.indexOf(j) === -1;
                    });
                } else {
                    result = result.concat(array);
                }
                return;
            }
        }

        error('Unknown browser query `' + selection + '`');
    });
    result = result.map(function (i) {
        var parts = i.split(' ');
        var name = parts[0];
        var version = parts[1];
        if ( version === '0' ) {
            return name + ' ' + browserslist.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[]} queries 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']