{"id":14384528,"url":"https://github.com/jquintozamora/polyfill-io-feature-detection","last_synced_at":"2025-04-10T20:50:48.020Z","repository":{"id":57327023,"uuid":"78938374","full_name":"jquintozamora/polyfill-io-feature-detection","owner":"jquintozamora","description":"Feature detection in the browser before loading polyfill using services like polyfill.io","archived":false,"fork":false,"pushed_at":"2018-07-29T10:25:21.000Z","size":38,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T03:53:21.475Z","etag":null,"topics":["feature-detection","polyfill","polyfill-service"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jquintozamora.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":"2017-01-14T12:16:25.000Z","updated_at":"2023-04-20T13:41:21.000Z","dependencies_parsed_at":"2022-09-13T19:00:44.975Z","dependency_job_id":null,"html_url":"https://github.com/jquintozamora/polyfill-io-feature-detection","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquintozamora%2Fpolyfill-io-feature-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquintozamora%2Fpolyfill-io-feature-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquintozamora%2Fpolyfill-io-feature-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jquintozamora%2Fpolyfill-io-feature-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jquintozamora","download_url":"https://codeload.github.com/jquintozamora/polyfill-io-feature-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248296494,"owners_count":21080301,"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":["feature-detection","polyfill","polyfill-service"],"created_at":"2024-08-28T18:01:27.058Z","updated_at":"2025-04-10T20:50:47.989Z","avatar_url":"https://github.com/jquintozamora.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Polyfill.io Features Detection in the browser\nFeature detection in the browser before loading polyfill using services like polyfill.io\n\n[![npm version](https://badge.fury.io/js/polyfill-io-feature-detection.svg)](https://badge.fury.io/js/polyfill-io-feature-detection)\n[![NSP Status](https://nodesecurity.io/orgs/jquinto/projects/97ba8357-aca4-44b2-b17a-62e69e9d0bd2/badge)](https://nodesecurity.io/orgs/jquinto/projects/97ba8357-aca4-44b2-b17a-62e69e9d0bd2)\n[![Code Climate](https://codeclimate.com/github/jquintozamora/polyfill-io-feature-detection/badges/gpa.svg)](https://codeclimate.com/github/jquintozamora/polyfill-io-feature-detection)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/jquintozamora/polyfill-io-feature-detection/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](Readme.md#want-to-contribute)\n\n[![NPM](https://nodei.co/npm/polyfill-io-feature-detection.png?downloads=true)](https://nodei.co/npm/polyfill-io-feature-detection/)\n\n\u003cbr /\u003e\n\n## When should I use polyfill-io-feature-detection?\n+ You want to isolate your app code from the browser supported features (applying polyfills)\n+ You have to add polyfills to yout web application because requires support to different browsers and devices\n+ You want to use polyfill service like [polyfill.io](https://polyfill.io/v2/docs) instead of including the polyfills in your bundle\n+ You want (should) to [load polyfills only when needed](https://philipwalton.com/articles/loading-polyfills-only-when-needed)\n+ You want to optimize the experience for users on modern browser\n+ You want to save the polyfill service call when possible (using this polyfillLoader)\n\nIf you meet all these requirements, you probably will love this package. Because it allows you to load polyfills dynamically only when your browser really need it.\n\n\n## Usage\n```js\nfunction App () {\n    // your app code here\n}\n\nimport { polyfillLoader } from 'polyfill-io-feature-detection';\npolyfillLoader({\n  \"features\": \"Promise\",\n  \"onCompleted\": App\n});\n```\n\n## Usage with React\n```js\n// index.jsx\nimport React from 'react';  \nimport {render} from 'react-dom';  \nimport App from './containers/App.jsx'; \n\nimport { polyfillLoader } from 'polyfill-io-feature-detection';\n// This function load polyfills only if needed. By default it uses polyfill.io\npolyfillLoader({\n  \"features\": \"Promise,fetch\",\n  \"onCompleted\": main\n});\n\n// That function will be called after loading polyfills\nfunction main() {\n  render(\n    \u003cApp /\u003e\n    , document.getElementById('starter')\n  );\n}\n```\nMore information: [Getting React to Load polyfills only when needed](https://blog.josequinto.com/2017/01/20/getting-react-to-load-polyfills-only-when-needed)\n\n## Want to contribute?\nAnyone can help make this project better\n\n## License\n(The MIT License)\nCopyright (c) 2017 Jose Quinto (https://blog.josequinto.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquintozamora%2Fpolyfill-io-feature-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjquintozamora%2Fpolyfill-io-feature-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjquintozamora%2Fpolyfill-io-feature-detection/lists"}