{"id":24225751,"url":"https://github.com/instea/polyfill-checker","last_synced_at":"2025-09-22T16:31:34.505Z","repository":{"id":57327017,"uuid":"126508884","full_name":"instea/polyfill-checker","owner":"instea","description":"Cross browser built-in functions/objects compatibility checker.","archived":false,"fork":false,"pushed_at":"2018-04-03T09:00:47.000Z","size":416,"stargazers_count":5,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-19T15:49:22.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/instea.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":"2018-03-23T16:06:13.000Z","updated_at":"2020-09-10T08:47:42.000Z","dependencies_parsed_at":"2022-09-21T01:50:21.144Z","dependency_job_id":null,"html_url":"https://github.com/instea/polyfill-checker","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/instea%2Fpolyfill-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2Fpolyfill-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2Fpolyfill-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instea%2Fpolyfill-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instea","download_url":"https://codeload.github.com/instea/polyfill-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233862657,"owners_count":18742010,"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":[],"created_at":"2025-01-14T08:15:55.685Z","updated_at":"2025-09-22T16:31:29.203Z","avatar_url":"https://github.com/instea.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polyfill checker\n\nCross browser built-in functions/objects compatibility checker.\n\n![demo downgrade](./doc/demo-downgrade-min.png)\n![demo injection](./doc/demo-injection-min.png)\n\n## Installation\n\n```bash\nnpm install polyfill-checker\n```\n\n## Usage\n\nImport and initialize polyfill checker before your application runs:\n\n```js\nif (process.env.NODE_ENV !== 'production') {\n  const { PolyfillChecker } = require('polyfill-checker')\n  const checker = new PolyfillChecker({\n    minBrowsers: {\n      ie: '9',\n      safari: '10',\n      chrome_android: '60',\n    }\n  })\n  checker.downgradeMode()\n  // checker.injectChecker()\n}\n```\n\nIt uses [browser-compat-data](https://github.com/mdn/browser-compat-data) to check browser compatibility.\n\nYou can find more in [example project](./example)\n\n## Api\n\n### Constructor\n\n`PolyfillChecker` constructor takes one optional config parameter, see [defaultConfig](./polyfill-checker/src/defaultConfig.js).\n\n### downgradeMode()\n\nRemoves not compatible built-ins (according to `minBrowsers`) from the browser.\nYour code will fail everytime you use such built-in without appropriate polyfill.\n\n### injectChecker()\n\nInjects checker interceptors to the not compatible built-ins (according to `minBrowsers`) and warns you in the console when using it.\n\n**Note:** Many 3rd party libraries use new built-ins if available (e.g. React uses Symbol, etc.) and frameworks may also use unsupported features in dev mode (e.g. during hot reload).\nYou can either ignore related errors or exclude such built-ins from checker (`exclude` config).\nBe carefull when using exclude config and include appropriate polyfill or don't use the feature in production code.\n\n**Note:** Using both `injectChecker` and `downgradeMode` doesn't make sense. You should use only one of them.\n\n## Integration\n\n3rd party libraries and frameworks often includes some polyfills into your application.\nWe provide presets to exclude those polyfilled built-ins from the checker:\n\n```js\nconst {\n  PolyfillChecker,\n  createReactAppPreset, // create-react-app\n} = require('polyfill-checker')\n\nconst checker = new PolyfillChecker({\n  exclude: [createReactAppPreset]\n})\n```\n\n## Contributing\n\nContributions are welcome! Just open an issues with any idea or pull-request if it is no-brainer. Make sure all tests and linting rules pass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstea%2Fpolyfill-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstea%2Fpolyfill-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstea%2Fpolyfill-checker/lists"}