Gathering detailed insights and metrics for browserslist-ga
Gathering detailed insights and metrics for browserslist-ga
Gathering detailed insights and metrics for browserslist-ga
Gathering detailed insights and metrics for browserslist-ga
npm install browserslist-ga
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
303 Stars
88 Commits
18 Forks
7 Watching
2 Branches
10 Contributors
Updated on 25 Oct 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-36.6%
4,570
Compared to previous day
Last week
-0.9%
26,999
Compared to previous week
Last month
5%
109,609
Compared to previous month
Last year
187.8%
1,647,843
Compared to previous year
4
Target browsers tailored to your audience.
Interested in a bot that does all of this for you? Click here!
In the root directory of your project run:
1npx browserslist-ga
(npx comes with npm 5.2+, for older versions run npm install -g browserslist-ga
and then browserslist-ga
)
(to run the latest code directly from GitHub, execute npx github:browserslist/browserslist-ga
instead)
You'll be asked to login with your Google Account (please see this issue if you are unable to sign in). Your access token will only be used locally to generate a browserslist-stats.json
file in the root of your project. After finishing the steps, you can use your stats with Browserlist by adding the following to your Browserslist config:
1> 0.5% in my stats # Or a different percentage
Note that you can query against your custom usage data while also querying against global or regional data. For example, the query > 1% in my stats, > 5% in US, 10%
is permitted.
Browsers update very often these days, with major releases getting published every month. With each new browser version comes support for new web platform features. Thanks to open source projects such as Autoprefixer and Babel we are able to use these features while supporting older browsers. But this backward compatibility comes with a cost. We can't really keep adding prefixes, polyfills and other fallbacks to support every browser ever invented.
Browserslist is an open source project that can minimize those costs by allowing you to configure which browsers you care about. It is supported by tools such as Autoprefixer, babel-preset-env, postcss-normalize and many others. Here's how you configure Browserslist:
1> 1% # I want to support browser versions that have more than 1% of global usage 2Last 2 versions # And the latest 2 versions of each browser 3IE 9 # And also Internet Explorer 9 specifically
The global browser usage data comes from caniuse.com and is downloaded from npm when you run npm install
.
Package managers such as npm and Yarn will generate a lockfile with the exact version of each package that was installed.
This means the caniuse database that is used to perform these queries will always be the same.
This is great because it's predictable, but it's important to update this package from time to time to keep up with the latest stats.
Apart from remembering to update this package, there's something else you should consider:
The point being, it's important to make decisions based on your audience. Browserslist-GA aims to help you with that. It integrates Google Analytics with Browserslist to keep your targeted browsers updated.
There are some differences compared to the caniuse
Google Analytics importer:
caniuse
Google Analytics parser only converts some of the data to Safari, while the remaining is left untracked (see #1).caniuse
and so is resolved to Chrome (or Chrome for Android) and the version is mapped to the nearest available version (see #2).All the praise goes to the humans and martians that develop and maintain Can I Use and Browserslist.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/14 approved changesets -- score normalized to 4
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More