{"id":13451742,"url":"https://github.com/uupaa/dynamic-import-polyfill","last_synced_at":"2026-01-20T04:03:03.117Z","repository":{"id":143825618,"uuid":"121418714","full_name":"uupaa/dynamic-import-polyfill","owner":"uupaa","description":"Dynamic import() polyfill for browser.","archived":false,"fork":false,"pushed_at":"2019-08-07T15:06:34.000Z","size":21,"stargazers_count":124,"open_issues_count":7,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-17T06:40:22.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/uupaa.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}},"created_at":"2018-02-13T18:19:33.000Z","updated_at":"2024-04-25T10:33:14.000Z","dependencies_parsed_at":"2023-07-23T02:46:18.191Z","dependency_job_id":null,"html_url":"https://github.com/uupaa/dynamic-import-polyfill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uupaa/dynamic-import-polyfill","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uupaa%2Fdynamic-import-polyfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uupaa%2Fdynamic-import-polyfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uupaa%2Fdynamic-import-polyfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uupaa%2Fdynamic-import-polyfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uupaa","download_url":"https://codeload.github.com/uupaa/dynamic-import-polyfill/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uupaa%2Fdynamic-import-polyfill/sbom","scorecard":{"id":913381,"data":{"date":"2025-08-11","repo":{"name":"github.com/uupaa/dynamic-import-polyfill","commit":"eb66ad8bc6d0bb1734f080ceadec938766486c41"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T20:05:23.700Z","repository_id":143825618,"created_at":"2025-08-24T20:05:23.701Z","updated_at":"2025-08-24T20:05:23.701Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28595330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: 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":[],"created_at":"2024-07-31T07:01:01.017Z","updated_at":"2026-01-20T04:03:03.096Z","avatar_url":"https://github.com/uupaa.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# Dynamic import() polyfill\n\nimportModule() is a polyfill of dynamic import JavaScript function.\n\n## Prepare\n\n`npm i -S @uupaa/dynamic-import-polyfill`\n\n## Browser support\n\n| Browser                   | `\u003cscript type=\"module\"\u003e` | `import()`\u003cbr\u003e(js native) | `importModule()`\u003cbr\u003e(polyfill) |\n|---------------------------|------------|---------|------------------------------|\n| Chrome                    | 61+        | 63+     | 61+                          |\n| Chrome (Android)          | 61+        | 63+     | 61+                          |\n| Safari                    | 10.1+      | 11+     | 10.1+                        |\n| Safari (iOS)              | 10.3+      | 11+     | 10.3+                        |\n| Firefox                   | 60+        | 67+     | 60+                          |\n| Edge                      | 16+        | :x:     | 16+                          |\n| new Edge (Chromium based) | 76+        | 76+     | 76+                          |\n| IE                        | :x:        | :x:     | :x:                          |\n\nBrowser should supports are ES Modules(`\u003cscript type=\"module\"\u003e`), Promise, Blob and window.URL functions.\n\n`import()` function browser compatibilitiy resources:\n\n- MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility\n- Can I use: https://caniuse.com/#search=import\n\n## Usage\n\nasync / await style\n\n```js\n\u003cscript type=\"module\"\u003e\nimport { importModule } from \"https://uupaa.github.io/dynamic-import-polyfill/importModule.js\";\n\n(async() =\u003e {\n  const Modules = {\n    Lib1: \"./Lib1.js\",\n    Lib2: \"https://example.com/Lib2.js\",\n  };\n  const { Lib1 } = await importModule(Modules.Lib1); // named export and import\n  const { default: Lib2 } = await importModule(Modules.Lib2); // default export and import\n\n  const lib1 = new Lib1();\n  const lib2 = new Lib2();\n  console.log( lib1.say() );\n  console.log( lib2.say() );\n})();\n```\n\nor Promise style.\n\n```js\n\u003cscript type=\"module\"\u003e\nimport { importModule } from \"https://uupaa.github.io/dynamic-import-polyfill/importModule.js\";\n\nimportModule(\"./Lib1.js\").then(Lib1 =\u003e {\n  const lib1 = new Lib1();\n  console.log( lib1.say() );\n});\n```\n\n\n## Demo\n\n- [use native import() or polyfill importModule()](https://uupaa.github.io/dynamic-import-polyfill/test/index.html)\n- [use native import()](https://uupaa.github.io/dynamic-import-polyfill/test/native.html)\n- [use polyfill importModule(abs-url)](https://uupaa.github.io/dynamic-import-polyfill/test/polyfill.abs.html)\n- [use polyfill importModule(rel-url)](https://uupaa.github.io/dynamic-import-polyfill/test/polyfill.rel.html)\n\n```html\n\u003c!DOCTYPE html\u003e\u003chtml\u003e\n\u003chead\u003e\n\u003cmeta charset=\"utf-8\"\u003e\u003ctitle\u003edynamic-import-polyfill\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cscript type=\"module\"\u003e\n    import { importModule } from \"../importModule.js\";\n\n    (async() =\u003e {\n      const Modules = {\n        a: \"https://uupaa.github.io/dynamic-import-polyfill/test/a.js\",\n        b: \"https://uupaa.github.io/dynamic-import-polyfill/test/b.js\",\n        c: \"https://uupaa.github.io/dynamic-import-polyfill/test/c.js\",\n      };\n\n      const usePolyfill = Date.now() % 2;\n\n      if (usePolyfill) {\n        console.log(\"use polyfill\");\n        const { a } = await importModule(Modules.a);\n        const { default: b } = await importModule(Modules.b);\n        const { c } = await importModule(Modules.c);\n        console.log( a(), b(), c() );\n      } else {\n        console.log(\"use native\");\n        // use native\n        const { a } = await import(Modules.a);\n        const { default: b } = await import(Modules.b);\n        const { c } = await import(Modules.c);\n        console.log( a(), b(), c() );\n      }\n    })();\n  \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuupaa%2Fdynamic-import-polyfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuupaa%2Fdynamic-import-polyfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuupaa%2Fdynamic-import-polyfill/lists"}