{"id":19125283,"url":"https://github.com/litson/polyfilla","last_synced_at":"2026-06-06T19:30:13.257Z","repository":{"id":88855548,"uuid":"106240994","full_name":"litson/Polyfilla","owner":"litson","description":"一个轻量级的polyfill加载器","archived":false,"fork":false,"pushed_at":"2018-05-07T07:24:29.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T09:44:03.698Z","etag":null,"topics":["loader","polyfills","shim"],"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/litson.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-09T05:42:03.000Z","updated_at":"2018-05-07T07:24:30.000Z","dependencies_parsed_at":"2023-06-12T21:30:42.544Z","dependency_job_id":null,"html_url":"https://github.com/litson/Polyfilla","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/litson%2FPolyfilla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litson%2FPolyfilla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litson%2FPolyfilla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litson%2FPolyfilla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litson","download_url":"https://codeload.github.com/litson/Polyfilla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240190909,"owners_count":19762590,"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":["loader","polyfills","shim"],"created_at":"2024-11-09T05:35:18.078Z","updated_at":"2026-06-06T19:30:13.034Z","avatar_url":"https://github.com/litson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PolyfillA\n\n一个轻量级的`polyfill`加载器。\n\n用户可以配置需要的 `polyfill` ，当浏览器需要 TA 的时候，则会去加载该（或多个） `polyfill` ，当加载完毕，则会运行回调。\n\n\n## API\n\n### Polyfilla.config( name, [config])\n\n- `{String | Object} name` 新增/修改 “一个” 或者“许多” `polyfill`\n- `{Object} [config]` 配置\n    - `{String} url` `polyfill` 的获取地址\n    - `{function} condition` 触发下载 `polyfill` 的条件\n- 用法\n```js\n\n    // 批量配置\n    Polyfilla.config(\n        {\n            promise: {\n                url: 'https://cdn.bootcss.com/es6-promise/4.1.1/es6-promise.min.js',\n                // 若当期浏览器支持Promise，则不会下载polyfill\n                condition() {\n                    return window.Promise\n                }\n            },\n            fetch  : {\n                url: 'https://cdn.bootcss.com/fetch/2.0.3/fetch.min.js',\n                condition() {\n                    return window.fetch\n                }\n            }\n        }\n    )\n    \n    // 或单独配置\n    Polyfilla.config(\n        'fetch',\n        {\n            url: 'https://cdn.bootcss.com/fetch/2.0.3/fetch.min.js',\n            condition() {\n                return window.fetch\n            }\n        }\n    )\n\n```\n\n### Polyfilla( polyfills, [cb] )\n\n- `{Array\u003cString\u003e} polyfills` 所有需要的 `polyfill`\n- `{Function} [cb]` 所有需要的 `polyfill` 加载完毕后运行的回调\n\n- 用法：\n\n```js\n\n    Polyfilla(\n        [\n            'fetch',\n            'promise'\n        ],\n        () =\u003e console.log( window.fetch, window.Promise )\n    )\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitson%2Fpolyfilla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitson%2Fpolyfilla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitson%2Fpolyfilla/lists"}