{"id":42830404,"url":"https://github.com/wide/polyfiller","last_synced_at":"2026-01-30T11:27:01.413Z","repository":{"id":49973464,"uuid":"267885572","full_name":"wide/polyfiller","owner":"wide","description":"Polyfills loader on demand.","archived":false,"fork":false,"pushed_at":"2021-06-07T09:48:31.000Z","size":14,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-08-19T02:27:08.984Z","etag":null,"topics":["modulus"],"latest_commit_sha":null,"homepage":null,"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/wide.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-05-29T15:00:36.000Z","updated_at":"2021-06-07T09:46:18.000Z","dependencies_parsed_at":"2022-09-19T17:21:27.813Z","dependency_job_id":null,"html_url":"https://github.com/wide/polyfiller","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/wide/polyfiller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fpolyfiller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fpolyfiller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fpolyfiller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fpolyfiller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wide","download_url":"https://codeload.github.com/wide/polyfiller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wide%2Fpolyfiller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28911821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T08:15:08.179Z","status":"ssl_error","status_checked_at":"2026-01-30T08:14:31.507Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["modulus"],"created_at":"2026-01-30T11:27:00.874Z","updated_at":"2026-01-30T11:27:01.406Z","avatar_url":"https://github.com/wide.png","language":"JavaScript","readme":"# Polyfiller\n\nLoad polyfills on demand.\n\n\n## Install\n\n```\nnpm install @wide/polyfiller --save\n```\n\n## Usage\n\nThis exemple will load `assets/polyfills/object-assign.js` on `IE 11` only:\n```js\nimport polyfiller from '@wide/polyfiller'\n\npolyfiller({\n  path: 'assets/polyfills/',\n  load: {\n    'object-assign.js': {\n      ie: '\u003c=11'\n    }\n  }\n})\n```\n- `path` public folder of compiled polyfills\n- `load` collection of polyfills to load, accept a key/value combination\n  - `key`: filename or url of the polyfill\n  - `value`: criteria to satisfies (see [bowser.satisfied](https://www.npmjs.com/package/bowser))\n\n\n## Built-in polyfills\n\n`@wide/polyfiller` comes with a set of well-known polyfills:\n- `babel.js`: `core-js/stable` and `regenerator-runtime/runtime`\n- `closest.js`: `element-closest-polyfill`\n- `object-fit.js`: `object-fit-images` and `object-fit-videos`\n- `picture-fill.js`: `picturefill`\n- `object-assign.js`: `es6-object-assign`\n- `fetch`: `whatwg-fetch`\n- `svg.js`: `svg4everybody`\n\nThese polyfills can be loaded in two steps, first import the needed ones using the `presets` collection:\n```js\nimport polyfiller from '@wide/polyfiller'\nimport presets from '@wide/polyfiller/lib/presets'\n\npolyfiller({\n  path: 'assets/polyfills/',\n  load: {\n    ...preset.babel,\n    ...preset.fetch,\n  }\n})\n```\n\nThen, you need to compile them into the `assets/polyfills`:\n```js\n// assets/polyfills/babel.js\nimport '@wide/polyfiller/lib/presets/babel'\n```\n```js\n// assets/polyfills/fetch.js\nimport '@wide/polyfiller/lib/presets/fetch'\n```\n\n\n## Capabilities\n\nTo resolve which polyfill must be loaded, `@wide/polyfiller` makes use of the `bowser` lib and expose the main feature of the browser:\n```js\nimport capabilities from '@wide/polyfiller/lib/capabilities'\n\ncapabilities.touch    // true | false\ncapabilities.platform // desktop | mobile\ncapabilities.os       // linux | macos | windows\ncapabilities.engine   // trident | gecko\ncapabilities.name     // ie | chrome | firefox\ncapabilities.version  // number\ncapabilities.chrome   // true | false\ncapabilities.opera    // true | false\ncapabilities.firefox  // true | false\ncapabilities.safari   // true | false\ncapabilities.edge     // true | false\ncapabilities.ie       // true | false\ncapabilities.webp     // true | false\n```\n\nThese capabilities can be exposed as `window.capabilities` and `body` css classes:\n```js\nimport { expose } from '@wide/polyfiller/lib/capabilities'\n\nexpose()\n```\n\n\n## Libraries\n\nThis package uses :\n- [`bowser`](https://github.com/lancedikson/bowser)\n\n\n## Authors\n\n- **Aymeric Assier** - [github.com/myeti](https://github.com/myeti)\n- **Julien Martins Da Costa** - [github.com/jdacosta](https://github.com/jdacosta)\n\n\n## License\n\nThis project is licensed under the MIT License - see the [licence](licence) file for details","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fpolyfiller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwide%2Fpolyfiller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwide%2Fpolyfiller/lists"}