• Stars
    star
    306
  • Rank 136,456 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This website uses Browserslist and Can I Use to display the compatible browsers for a browsers query.

Browserslist Website

Browserslist logo by Anton Popov

This website uses Browserslist and Can I Use to display the compatible browsers for a browsers query.

browsersl.ist

HTTP API

You can use the site API in your own applications.

https://browsersl.ist/api/browsers?q=defaults&region=alt-ww
  • q β€” query or config. If config is provided it should be in .browserslist file format, not package.json-like. Examples are available on the website or in the browserslist repository. defaults by default.
  • region β€” region code. List of all region codes can be found at caniuse-lite/data/regions. alt-ww by default.

Response example

// https://browsersl.ist/api/browsers?q=>defaults+and+supports+es6-module&region=alt-as

{
  "config": ">0.3%",
  "lint": [
    {
      "id": "countryWasIgnored",
      "message": "Less than 80% coverage in `China`, `Nigeria`, `Tanzania`, `Ghana`, and `Uganda` regions"
    }
  ],
  "region": "alt-as",
  "coverage": 88.44,
  "versions": {
    "browserslist": "4.21.3",
    "caniuse": "1.0.30001381"
  },
  "updated": 1675156330646,
  "browsers": [
    {
      "id": "chrome",
      "name": "Chrome",
      "coverage": 17.06,
      "versions": {
        "102": 0.72,
        "103": 16.32
      }
    }
    ...
  ]
}

Errors

If you send a request with an error, you will receive error message with the status 400.

// https://browsersl.ist/api/browsers?q=>0%&region=XX

{
  "message": "Unknown region name `XX`."
}

Development

We recommend to install Prettier and EditorConfig plugins to your text editor.

To run a local copy for development:

  1. Install correct versions of Node.js and pnpm. There are two ways:

    • With asdf version manager:

      asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
      asdf plugin-add pnpm https://github.com/jonathanmorley/asdf-pnpm.git
      asdf install
    • Manually by check versions in .tool-versions.

  2. Install dependencies:

    pnpm install
  3. Run local server with client-side watcher.

    pnpm start

To run local server in production mode:

pnpm ssdeploy run