{"id":20569612,"url":"https://github.com/xiaody/urw-loader","last_synced_at":"2026-05-29T08:32:05.804Z","repository":{"id":32822747,"uuid":"36415661","full_name":"xiaody/urw-loader","owner":"xiaody","description":"A minimal frontend resource loader","archived":false,"fork":false,"pushed_at":"2017-03-10T12:26:53.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-08T09:18:02.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaody.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-05-28T04:57:53.000Z","updated_at":"2017-03-03T08:11:27.000Z","dependencies_parsed_at":"2022-09-06T09:42:00.419Z","dependency_job_id":null,"html_url":"https://github.com/xiaody/urw-loader","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/xiaody/urw-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Furw-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Furw-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Furw-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Furw-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaody","download_url":"https://codeload.github.com/xiaody/urw-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaody%2Furw-loader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33644254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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-11-16T05:08:58.756Z","updated_at":"2026-05-29T08:32:05.786Z","avatar_url":"https://github.com/xiaody.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"http://standardjs.com/\"\u003e\n    \u003cimg src=\"https://cdn.rawgit.com/feross/standard/master/badge.svg\" alt=\"standardjs logo\"\n        title=\"JavaScript Standard Style\" align=\"right\" /\u003e\n\u003c/a\u003e\n\nA minimalist frontend resource loader that you can actually understand and extend.\n\n725 bytes (gzip)\n\nNotice: urw-loader is expected to be used in an environment which has Promise and common Array methods.\n\n# sample code\n\nBy default, a urw loader recognize strings as javascript file uri and load them by \u0026lt;script async\u003e tags.\n\n## a simple loader\n\n```javascript\nvar loader = new URW\nvar promise1 = loader.load(\n  ['http://s0.cdn.net/zepto.js', 'http://s0.cdn.net/hammer.js'],\n  'http://s0.cdn.net/paidui/page.js',\n  function initPage () {\n    // use zepto, hammer, page.js\n  }\n)\n/* the timeline for above code */\n// ====zepto=====\n// ====hammer=====\n//                  ===page.js====\n//                                   initPage()\n```\n\n## use middlewares\n\n```javascript\nvar loader = new URW({\n  domain: '//s0.cdn.net/'\n})\n\nloader.use(function addext (resource) {\n  return resource + '.js'\n}).use(function comboGroup (resource) {\n  return this.config.domain + '?combo=' + resource.join()\n}).use(function timing (resource, progress) {\n    var start = Date.now()\n    progress.then(function () {\n        console.info('urw timing:', Date.now() - start, resource)\n    })\n})\n\nvar promise2 = loader.load(\n  ['zepto', 'hammer'],\n  'paidui/page'\n).then(function initPage () {})\n```\n\n\n# loadable resources\nString, function, Promise and Array are loadable.\n\n# download method\nYou can overwrite the URW.util.load or loader.util.load method to change the download method,\ne.g. when you want to load js by xhr or load css.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaody%2Furw-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaody%2Furw-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaody%2Furw-loader/lists"}