{"id":19714374,"url":"https://github.com/peternaydenov/dynamic-import","last_synced_at":"2025-07-26T01:17:32.939Z","repository":{"id":197750464,"uuid":"699253550","full_name":"PeterNaydenov/dynamic-import","owner":"PeterNaydenov","description":"Function that allows you to dynamically import ES modules in your project. Works in Vite projects.","archived":false,"fork":false,"pushed_at":"2025-06-19T05:47:58.000Z","size":674,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T06:33:18.853Z","etag":null,"topics":["compatible","dynamic","es","import","modules","vite"],"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/PeterNaydenov.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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,"zenodo":null}},"created_at":"2023-10-02T09:01:34.000Z","updated_at":"2025-06-19T05:48:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bf64fdf-6216-466d-b035-40127da1d8ed","html_url":"https://github.com/PeterNaydenov/dynamic-import","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"49bb3cc22600a61cb760a1fdc7d1944e380426b6"},"previous_names":["peternaydenov/dynamic-import"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PeterNaydenov/dynamic-import","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fdynamic-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fdynamic-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fdynamic-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fdynamic-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterNaydenov","download_url":"https://codeload.github.com/PeterNaydenov/dynamic-import/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fdynamic-import/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264016713,"owners_count":23544623,"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":["compatible","dynamic","es","import","modules","vite"],"created_at":"2024-11-11T22:31:18.666Z","updated_at":"2025-07-07T05:02:45.577Z","avatar_url":"https://github.com/PeterNaydenov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Import (@peter.naydenov/dynamic-import)\n\n![version](https://img.shields.io/github/package-json/v/peterNaydenov/dynamic-import)\n![license](https://img.shields.io/github/license/peterNaydenov/dynamic-import)\n\n\nFunction that allows you to dynamically import ES modules in your project. Works in **Vite** projects.\n\n\n\n## Installation\n\n```bash\nnpm i @peter.naydenov/dynamic-import\n```\n\n\n\n## Usage\n\n```js\n// for es6 projects:\nimport dynamicImport from '@peter.naydenov/dynamic-import';\n\n// for commonjs projects:\nconst dynamicImport = require('@peter.naydenov/dynamic-import');\n\n\n\n// Provide first the import pattern function like this one:\nconst importPattern = (name) =\u003e import(`./modules/${name}.js`);\nconst importModules = dynamicImport ( importPattern );\n\n// Then use it to import modules:\nimportList = ['module1', 'module2', 'module3'];\nimportModules ( importList )  // Expect string[] and returns a promise\n            .then ( moduleList =\u003e {\n                        // Do something with the moduleList\n            })\n```\n\n\n\n## Credits\n'@peter.naydenov/dynamic-import' was created and supported by Peter Naydenov.\n\n\n\n## License\n'@peter.naydenov/dynamic-import' is released under the [MIT License](http://opensource.org/licenses/MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeternaydenov%2Fdynamic-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeternaydenov%2Fdynamic-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeternaydenov%2Fdynamic-import/lists"}