{"id":14989310,"url":"https://github.com/dburles/modulepreload-koa","last_synced_at":"2026-02-08T12:37:57.525Z","repository":{"id":198580833,"uuid":"700786081","full_name":"dburles/modulepreload-koa","owner":"dburles","description":"Koa middleware for generating modulepreload link relations based on a JavaScript module import graph.","archived":false,"fork":false,"pushed_at":"2024-07-31T05:51:09.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T01:57:34.714Z","etag":null,"topics":["esm","esmodules","header","http","koa","link","middleware","modulepreload"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/modulepreload-koa","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/dburles.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":"2023-10-05T09:41:09.000Z","updated_at":"2024-07-31T05:50:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"c56a5e3c-7ca9-47e7-a07a-3677f0a39aad","html_url":"https://github.com/dburles/modulepreload-koa","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"c70abde7f123c82d823f9a2b8693fee651fbc5d7"},"previous_names":["dburles/modulepreload-koa"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dburles/modulepreload-koa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburles%2Fmodulepreload-koa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburles%2Fmodulepreload-koa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburles%2Fmodulepreload-koa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburles%2Fmodulepreload-koa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dburles","download_url":"https://codeload.github.com/dburles/modulepreload-koa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dburles%2Fmodulepreload-koa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29230378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T12:28:20.184Z","status":"ssl_error","status_checked_at":"2026-02-08T12:28:19.510Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["esm","esmodules","header","http","koa","link","middleware","modulepreload"],"created_at":"2024-09-24T14:18:06.968Z","updated_at":"2026-02-08T12:37:57.469Z","avatar_url":"https://github.com/dburles.png","language":"JavaScript","readme":"# modulepreload-koa\n\nKoa middleware for generating [modulepreload](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/modulepreload) link relations for a [Link](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link) entity-header based on the requested JavaScript modules import graph. This will prevent request waterfalls for nested module imports. Supports import maps.\n\n## Install\n\n```sh\nnpm i modulepreload-koa\n```\n\n## Usage example\n\n```js\nimport Koa from \"koa\";\nimport serve from \"koa-static\";\nimport createModulePreloadMiddleware from \"modulepreload-koa/createModulePreloadMiddleware.mjs\";\n\nconst app = new Koa();\n\nconst APP_ROOT = \"app\";\n\napp.use(createModulePreloadMiddleware(APP_ROOT));\napp.use(serve(APP_ROOT));\n\napp.listen(3000);\n```\n\n## API\n\n### `createModulePreloadMiddleware(path[, options])`\n\n- `path` {string} Path to the application root directory, eg \"app\".\n- `options` {Object}\n  - `extensions` {Array\u0026lt;string\u0026gt;} The file extensions to consider for module scripts. Defaults to: `[\"mjs\", \"js\"]`.\n  - `importMap` {string} Import map string.\n  - `cache` {Object} A custom (map-like) cache.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdburles%2Fmodulepreload-koa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdburles%2Fmodulepreload-koa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdburles%2Fmodulepreload-koa/lists"}