{"id":16731443,"url":"https://github.com/skratchdot/browsercheck","last_synced_at":"2026-05-20T15:15:08.452Z","repository":{"id":57160742,"uuid":"318301984","full_name":"skratchdot/browsercheck","owner":"skratchdot","description":"a tool to check your scripts for browser compatibility","archived":false,"fork":false,"pushed_at":"2021-01-01T18:58:14.000Z","size":6062,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-22T07:51:35.150Z","etag":null,"topics":["babel","browser","browserlist","browserslist","caniuse","compatibility","preset-env"],"latest_commit_sha":null,"homepage":"https://projects.skratchdot.com/browsercheck/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-03T19:45:38.000Z","updated_at":"2022-02-10T19:51:57.000Z","dependencies_parsed_at":"2022-08-24T08:11:20.161Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/browsercheck","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fbrowsercheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fbrowsercheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fbrowsercheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fbrowsercheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/browsercheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243770286,"owners_count":20345276,"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":["babel","browser","browserlist","browserslist","caniuse","compatibility","preset-env"],"created_at":"2024-10-12T23:37:16.508Z","updated_at":"2026-05-20T15:15:03.406Z","avatar_url":"https://github.com/skratchdot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# browsercheck\n\na tool to check your scripts for browser compatibility\n\n## cli installation \u0026 usage\n\ninstall the tool globally using npm\n\n```bash\nnpm install -g @skratchdot/browsercheck\n```\n\ncheck if `bundle.js` will \"work\" in ie 8\n\n```bash\nbrowsercheck validate --targets \"ie 8\" bundle.js\n```\n\n### node installation \u0026 usage\n\nsave the library to your dependencies using npm\n\n```bash\nnpm install -g @skratchdot/browsercheck\n```\n\ncheck if some javascript is valid in ie 8\n\n`index.js`:\n\n```javascript\nconst { validate } = require('browsercheck');\nconst result1 = validate('const life = 42;', 'ie 8');\nconsole.log(result1.valid); // false\nconst result2 = validate('var life = 42;', 'ie 8');\nconsole.log(result2.valid); // true\n```\n\n## how does it work?\n\nthis script is pretty dumb (and slow)! it relies on other libraries to do all the heavy lifting.\n\nall we do is take the input source code, and run it against a \"bare minimum\" babel transform twice.\n\nfirst, we run it through a minimal babel config with no presets.\nsecond, we run it through the same minimal babel config, but include the `@babel/preset-env` preset, passing in the provided `targets`.\n\nnow we compare the first and second transform. if `@babel/preset-env` didn't need to change anything, then the code should \"work\"\nagainst your targets (there are of course caveats to this rule: for instance DOM polyfills and CSS aren't checked).\n\n## why do you need this?\n\nwebpack recommends not transpiling node_modules (for speed- and other reasons). sometimes the libraries you depend on\ndo not support the same set of browsers your app does. when this happens- it's hard to detect which code in node_modules\nwill \"break\" your site. the goal of this project is to help detect that scenario.\n\nonce you discover the \"culprits\", you can edit your webpack config so you start transpiling those libs:\nhttps://github.com/webpack/webpack/issues/2031#issuecomment-219040479\n\n## see also\n\n- https://github.com/browserslist/browserslist\n- https://github.com/robatwilliams/es-compat\n- https://github.com/amilajack/eslint-plugin-compat\n- https://github.com/anandthakker/doiuse\n- https://browserslist.dev/\n- https://caniuse.com/\n\n## ideas/todo\n\n- auto update cli\n- give a way to update the browserlist/caniuse db via cli\n- command \"detect\" that finds the \"lowest\" version of each browser is supported\n- should cli support globs (similar usage to eslint, prettier, etc)?\n- look into preset-env, and why Promises are polyfilled in chrome 66\n- improve demo site and docs\n- add info about caveats and edge-cases\n- browser plugins/bookmarklets to \"test\" files in network tab\n- add debug module\n-\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fbrowsercheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fbrowsercheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fbrowsercheck/lists"}