{"id":16298067,"url":"https://github.com/maximelafarie/browizard","last_synced_at":"2025-08-23T22:18:46.017Z","repository":{"id":44016886,"uuid":"232580090","full_name":"maximelafarie/browizard","owner":"maximelafarie","description":"A javascript browser compatibility checker based on MDN API data","archived":false,"fork":false,"pushed_at":"2025-04-24T00:32:51.000Z","size":296,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T13:18:32.719Z","etag":null,"topics":["browizard","browser","caniuse","caniuse-data","checker","ci","circle-ci","compatibility","compatibility-testing","hacktoberfest","inspector","mdn","mdn-api","npm","npm-package","threshold","travis","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximelafarie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-08T14:20:06.000Z","updated_at":"2025-03-13T21:12:31.000Z","dependencies_parsed_at":"2023-02-07T07:00:32.732Z","dependency_job_id":null,"html_url":"https://github.com/maximelafarie/browizard","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/maximelafarie/browizard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximelafarie%2Fbrowizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximelafarie%2Fbrowizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximelafarie%2Fbrowizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximelafarie%2Fbrowizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximelafarie","download_url":"https://codeload.github.com/maximelafarie/browizard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximelafarie%2Fbrowizard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262981628,"owners_count":23394561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browizard","browser","caniuse","caniuse-data","checker","ci","circle-ci","compatibility","compatibility-testing","hacktoberfest","inspector","mdn","mdn-api","npm","npm-package","threshold","travis","travis-ci"],"created_at":"2024-10-10T20:43:28.819Z","updated_at":"2025-07-01T14:36:44.931Z","avatar_url":"https://github.com/maximelafarie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"assets/logo.png\" width=\"500\" /\u003e\n\n[![Build Status](https://travis-ci.org/maximelafarie/browizard.svg?branch=master)](https://travis-ci.org/maximelafarie/browizard)\n[![npm version](https://badge.fury.io/js/browizard.svg)](https://badge.fury.io/js/browizard)\n[![npm downloads](https://img.shields.io/npm/dm/browizard.svg)](https://npmjs.org/browizard)\n\n# browizard\nA javascript browser compatibility checker based on [MDN API](https://developer.mozilla.org/) data\n\n# Install\nIt's better to install browizard globally on your machine:\n\n```bash\nnpm i -g browizard\n```\n\n# How to use\nYou can run browizard directly in a folder to scan, or provide a remote directory like this:\n\n```bash\nbrowizard --directory|d=\u003cDIRECTORY-PATH\u003e\n```\n\n# Thresholds\nYou 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.\n\nThe script will return a `0` exit code if succeed, else `1`.\n\nYou can pass thresholds like the following (be sure to pass [a valid](https://jsonlint.com/) JSON object **between simple quotes**):\n\n```bash\nbrowizard --threshold|t='{\"chrome\": \"60\", \"firefox\": \"55\", \"edge\": \"16\"}'\n```\n\nIt 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).\n\n# Ignoring files\nSometimes, 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...\n\nIn 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.\n\nThe \"file contains\" example:\n```bash\nbrowizard --d=dist/js --e|exclude='chunk|another-file'\n```\n\nThe \"CSS and SCSS exclusion\" example (even though the script already ignore them but **will support them in the future**)\n```bash\nbrowizard --d=dist/js --e|exclude='([a-zA-Z0-9\\s_\\\\.\\-\\(\\):])+(.css|.scss)$'\n```\n\n# Increase buffer chunk size\nIf you're scanning files with very long strings (more that 65000 chars approx.), the script may fail. It's due to the default size of a `readStream` chunk defined in NodeJS. In order to fix that, you can use the `--b` or `--buffersize` option. `String` and `Number` accepted.\n\nExample: \n```bash\nbrowizard --d=dist/js --b|buffersize=$(( 128 * 1024 ))\n```\n\nor directly: \n```bash\nbrowizard --d=dist/js --b|buffersize='131072'\n```\n\n# How it works\nThe script will deep read all of the `.js` files and search for prototypes functions. Then it'll ask the MDN Javascript API for compatibility.\n\nThe script outputs something like that:\n```bash\nRead entire file polyfills-es2015.234d8bd921252538356d.js ✅\nRead entire file runtime-es5.465c2333d355155ec5f3.js ✅\nRead entire file runtime-es2015.703a23e48ad83c851e49.js ✅\nRead entire file polyfills-es5.27440667c81456d005bd.js ✅\nRead entire file scripts.cceedd438f7a65227341.js ✅\nRead entire file main-es2015.9f55004bbfcda26c5ba0.js ✅\nRead entire file main-es5.dc80fe38ce5fdad7a196.js ✅\nMinimal supported versions for scanned files are: {\n  chrome: '70',\n  chrome_android: '70',\n  edge: '18',\n  firefox: '63',\n  firefox_android: '63',\n  ie: '9',\n  nodejs: true,\n  opera: '57',\n  opera_android: '49',\n  safari: '9',\n  safari_ios: '9',\n  samsunginternet_android: '8.0',\n  webview_android: '≤37'\n}\nChecking threshold validity...\nThreshold validity check terminated successfully\nProcess exited with code:  0\nExecution time: 8423ms\n```\nYou've got:\n* The filename after it has been completely scanned (and the read status)\n* The minimal supported version for each browser\n* The threshold check status (if option provided to the command)\n* The process exit code (0 = success | \u003e 0 = error)\n* The script execution time\n\n# Troubleshooting \u0026 user notice\n\n## The \"error while reading\" error\nSometimes, you can fall into this issue:\n\n```bash\nError while reading file chunk-vendors.63f8bc84.js ❌\n SyntaxError: Unexpected token (1:5358)\n    at Parser.pp$4.raise (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:2836:15)\n    at Parser.pp.unexpected (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:689:10)\n    at Parser.pp$3.parseExprAtom (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:2260:12)\n    at Parser.pp$3.parseExprSubscripts (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:2089:2)\n    at Parser.pp$3.parseMaybeUnary (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:2066:19)\n    at Parser.pp$3.parseExprOps (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:2010:21)\n    at Parser.pp$3.parseMaybeConditional (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:1993)\n    at Parser.pp$3.parseMaybeAssign (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:1968:21)\n    at Parser.pp$3.parseExpression (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:1933:21)\n    at Parser.pp$1.parseStatement (/Users/maximelafarie2/dev/github/repos/browser-spector/node_modules/acorn/dist/acorn.js:877:47) {\n  pos: 5358,\n  loc: Position { line: 1, column: 5358 },\n  raisedAt: 5358\n}\n[■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] | about.2868ee64.js ✅ | 11/0\n[■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] | app.d0da9fcf.js ✅ | 183/0\n[                                        ] | {filename} | 0/100\n```\n\nAfter some investigations, we found out that it's caused by **newlines** in files. It seems that the `chunk-vendor` file of VueJS build match this case.\n\nSo in order to let the script watch your transpiled files (`about`, `app`, ...) you can refer to the [Ignoring files section](#ignoring-files) of this readme.\n\nYou'll end up with something like: `browizard --d=dist/js --e='chunk'`. And then the script will skip all files matching your exclusion rule.\n\n## Why you should be aware using this script\n\nBrowizard (whatever how cool it is) isn't 100% reliable. Two main warning points:\n\n### It only crawls your files and take the **first** entry returned by the MDN API\nExample:\n\nIn one of your files, there is the `indexOf` function. The scripts find it and checks the MDN API for minimal browser support versions. The dilemma is that there is three types of `indexOf` property:\n* for `Arrays`\n* for `Strings`\n* for `TypedArrays`\n\nBut the support version isn't the same for a similar property (for the same browser!), so here's the limit:\n* `Arrays`: `Chrome \u003e=1`\n* `Strings`: `Chrome \u003e=1`\n* `TypedArrays`: `Chrome \u003e=45`\n\nSo if the `indexOf` prop scanned by the script in one of your files is for a `TypedArray`, the script will take the `Array` prop and will return a minimal version for Chrome of 1.\n\nIn main cases, other properties versions are overriding this error... but it is present!\n\n**So be careful if you want to break your CI execution if the threshold doesn't match the one you provided. It may be better using it for retriving minimal supported versions for your project.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximelafarie%2Fbrowizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximelafarie%2Fbrowizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximelafarie%2Fbrowizard/lists"}