{"id":16777278,"url":"https://github.com/spantaleev/comploader","last_synced_at":"2026-02-26T02:02:22.895Z","repository":{"id":7781892,"uuid":"9151695","full_name":"spantaleev/comploader","owner":"spantaleev","description":"Web component loader for sane/practical people.","archived":false,"fork":false,"pushed_at":"2025-03-16T11:34:30.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T03:33:08.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spantaleev.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}},"created_at":"2013-04-01T17:13:01.000Z","updated_at":"2025-03-16T11:34:33.000Z","dependencies_parsed_at":"2022-09-13T15:32:06.183Z","dependency_job_id":null,"html_url":"https://github.com/spantaleev/comploader","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/spantaleev/comploader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spantaleev%2Fcomploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spantaleev%2Fcomploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spantaleev%2Fcomploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spantaleev%2Fcomploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spantaleev","download_url":"https://codeload.github.com/spantaleev/comploader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spantaleev%2Fcomploader/sbom","scorecard":{"id":840212,"data":{"date":"2025-08-11","repo":{"name":"github.com/spantaleev/comploader","commit":"64697c7d25a6a03db41c6f0c4986a1b1dca6856e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/13 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":"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":"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":"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":"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: BSD 3-Clause \"New\" or \"Revised\" 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-23T20:17:36.286Z","repository_id":7781892,"created_at":"2025-08-23T20:17:36.287Z","updated_at":"2025-08-23T20:17:36.287Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-13T07:24:13.821Z","updated_at":"2026-02-26T02:02:22.880Z","avatar_url":"https://github.com/spantaleev.png","language":"JavaScript","readme":"comploader\n==========\n\n**comploader** is a *web component* loader for sane/practical people.\n\nA *web component* is anything that consists of one or more JavaScript/CSS files.\n\ncomploader lets you:\n * register/define components (name and configuration)\n * load components on demand\n\nA component can:\n * include many CSS files\n * include many JavaScript files\n * depend (and be loaded after) other components\n\n\nWhat problem does this solve?\n-----------------------------\n\nOn-demand loading of web resources (JavaScript/CSS libraries).\n\n\nUsage\n-----\n\n\t\u003cscript type=\"text/javascript\" src=\"comploader.js\"\u003e\u003c/script\u003e\n\n\t\u003c!-- Define the components (only got one here) --\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.register(\"jquery\", {\n\t\t\t\"scripts\": [\"/path/to/jquery.js\"]\n\t\t});\n\t\u003c/script\u003e\n\n\t\u003c!-- Make use of the components --\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.load(\"jquery\", function () {\n\t\t\t//jQuery is now loaded - use it.\n\t\t\t$(document.body).css('backgroundColor', 'red');\n\t\t});\n\t\u003c/script\u003e\n\n\nSee the examples directory for more.\n\n\nWhat if a component depends on other components?\n------------------------------------------------\n\nNo problem.\nTell comploader about the dependency and it will load components in the correct order.\n\n\t\u003c!-- Define the components --\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.register(\"jquery\", {\n\t\t\t\"scripts\": [\"/path/to/jquery.js\"]\n\t\t});\n\n\t\tcomploader.register(\"jqueryui\", {\n\t\t\t\"requires\": [\"jquery\"],\n\t\t\t\"stylesheets\": [\"/path/to/jquery-ui.css\"],\n\t\t\t\"scripts\": [\"/path/to/jquery-ui.js\"]\n\t\t});\n\t\u003c/script\u003e\n\n\t\u003c!-- Make use of the components --\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.load(\"jqueryui\", function () {\n\t\t\t//Both components are now loaded (jQuery 1st and then jQuery UI)\n\t\t});\n\t\u003c/script\u003e\n\n\nWhat about Subresource Integrity?\n---------------------------------\n\ncomploader supports [Subresource Integrity](http://www.w3.org/TR/SRI/) to guarantee\nthat loaded resources haven't been tampered with\nin [browsers that support it](http://caniuse.com/#search=SRI)).\n\nTo use, just define your components like this:\n\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.register(\"jquery\", {\n\t\t\t\"scripts\": [\n\t\t\t\t{\n\t\t\t\t\t\"url\": \"https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js\",\n\t\t\t\t\t\"integrity\": \"sha384-6ePHh72Rl3hKio4HiJ841psfsRJveeS+aLoaEf3BWfS+gTF0XdAqku2ka8VddikM\"\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\t\u003c/script\u003e\n\nThis works for both scripts and stylesheets.\n\nGenerating the integrity digest hashes can be done like this:\n\n\tcat some-file.js | openssl dgst -sha384 -binary | openssl base64 -A\n\n\nCan I load ESM modules?\n-----------------------\n\nYes, here's an example:\n\n\t\tcomploader.register(\"turbo\", {\n\t\t\t\"scripts\": [\n\t\t\t\t{\n\t\t\t\t\t\"url\": \"https://unpkg.com/@hotwired/turbo@8.0.13/dist/turbo.es2017-esm.js\",\n\t\t\t\t\t\"type\": \"module\"\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\n\t\tcomploader.load('turbo', function () {\n\t\t\tconsole.log(window.Turbo);\n\t\t});\n\t\u003c/script\u003e\n\n\nHow is this different than RequireJS?\n-------------------------------------\n\n[RequireJS](http://www.requirejs.org/) is focused on JavaScript files (modules) written in a certain special way ([AMD](https://github.com/amdjs/amdjs-api/wiki/AMD)).\n\nMost web libraries **ARE NOT** written like that and thus **DO NOT** support RequireJS.\nUsing such libraries in RequireJS projects is a pain.\n\njQuery plugins also do not fit well into the \"modules\" paradigm.\n\nAdditionally, some libraries (Twitter Bootstrap, jQuery UI) often include CSS stylesheets (not just JavaScript files).\nRequireJS does not handle CSS loading.\n\nTo summarize:\n * RequireJS is a pain to use (in general) - just [read about it](http://www.requirejs.org/)\n * RequireJS is a pain to use (for loading libraries lacking AMD support)\n * RequireJS does not handle loading of CSS files\n * RequireJS is huge and complex compared to comploader (81KB vs 4KB)\n\n\nHow do I later minify/combine some of my components?\n----------------------------------------------------\n\ncomploader cannot optimize and combine your resources like RequireJS claims to do.\nIt's your job to decide what should be combined and how that's done.\n\nSuppose that at first you had a \"jqueryui\" component registered and loaded on demand with comploader.\n\nYou later decide that:\n * it should be loaded via regular standalone `\u003clink\u003e` and `\u003cscript\u003e` tags\n * it should be combined/minified into your combined.css/combined.js files (how you do that is up to you)\n\nTo keep all your existing code (and components that depend on \"jqueryui\") working, you only need to make minor changes.\n\nBefore:\n\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.register(\"jqueryui\", {\n\t\t\t\"stylesheets\": [\"/path/to/jquery-ui.css\"],\n\t\t\t\"scripts\": [\"/path/to/jquery-ui.js\"]\n\t\t});\n\t\u003c/script\u003e\n\nAfter:\n\n\t\u003c!-- jQuery UI is now is now part of combined.css/combined.js --\u003e\n\t\u003clink rel=\"stylesheet\" href=\"combined.css\" /\u003e\n\t\u003cscript type=\"text/javascript\" src=\"combined.js\"\u003e\u003c/script\u003e\n\n\t\u003c!--\n\t\tRegister (or re-register) the jqueryui component with an empty configuration.\n\t\tCode that later calls `comploader.load(\"jqueryui\")` will consider it loaded.\n\t--\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tcomploader.register(\"jqueryui\", {});\n\t\u003c/script\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspantaleev%2Fcomploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspantaleev%2Fcomploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspantaleev%2Fcomploader/lists"}