README
browizard
A javascript browser compatibility checker based on MDN API data
Install
It's better to install browizard globally on your machine:
npm i -g browizard
How to use
You can run browizard directly in a folder to scan, or provide a remote directory like this:
browizard --directory|d=<DIRECTORY-PATH>
Thresholds
You can provide a thresholds for any browser listed below. Any provided browser version will be compared to the final report for less or equal versions.
The script will return a 0
exit code if succeed, else 1
.
You can pass thresholds like the following (be sure to pass a valid JSON object between simple quotes):
browizard --threshold|t='{"chrome": "60", "firefox": "55", "edge": "16"}'
It will either return a success message like: Threshold validity check terminated successfully
or a detailed error message like: Invalid threshold on chrome. Expected: 60 or less, current: 70.
with an exit code 1
(so it can be used in CIs).
Ignoring files
Sometimes, you simply don't want to check some files. Either because it's not relevant for your test or it simply makes the script fail...
In order to prevent some files to be checked, you can use the --e
or --exclude
option. It takes a RegExp string and will try to match the files with i
flag.
The "file contains" example:
browizard --d=dist/js --e|exclude='chunk|another-file'
The "CSS and SCSS exclusion" example (even though the script already ignore them but will support them in the future)
browizard --d=dist/js --e|exclude='([a-zA-Z0-9\s_\\.\-\(\):])+(.css|.scss)