browserslist / browserslist

🦔 Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env

Home Page:https://browsersl.ist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimize json output format for frontend display

winston0410 opened this issue · comments

From this command, I get the following output.

npx browserslist --json
{
  "browsers": [
    "and_chr 109",
    "and_ff 109",
    "and_qq 13.1",
    "android 109",
    "chrome 109",
    "chrome 108",
    "chrome 107",
    "edge 109",
    "edge 108",
    "edge 107",
    "firefox 109",
    "firefox 108",
    "firefox 107",
    "firefox 102",
    "ios_saf 16.3",
    "ios_saf 16.2",
    "ios_saf 16.1",
    "ios_saf 16.0",
    "ios_saf 15.6",
    "ios_saf 15.5",
    "ios_saf 14.5-14.8",
    "node 19.3.0",
    "node 18.12.0",
    "node 16.19.0",
    "node 14.21.0",
    "op_mob 73",
    "opera 94",
    "opera 93",
    "safari 16.3",
    "safari 16.2",
    "safari 16.1",
    "safari 15.6",
    "samsung 19.0",
    "samsung 18.0"
  ]
}

The output is helpful for knowing what browser is supported, but it is not useful for displaying on a website to tell user which browser they should use. Right now I guess we will need custom parsing to turn transform the result first.

Not sure about the best format yet, but is this something @ai you would consider useful and include in this project? I would love to contribute if that is something you happy with