{"id":16396053,"url":"https://github.com/theprofs/defer-script","last_synced_at":"2025-12-12T03:49:46.879Z","repository":{"id":58220447,"uuid":"117365692","full_name":"TheProfs/defer-script","owner":"TheProfs","description":"Load deferred scripts that survive vulcanisation/bundling in Polymer 1.x","archived":false,"fork":false,"pushed_at":"2018-01-15T08:44:23.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T12:48:22.452Z","etag":null,"topics":["asset-loading","polymer","web-components"],"latest_commit_sha":null,"homepage":"","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/TheProfs.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":"2018-01-13T17:58:12.000Z","updated_at":"2018-02-21T18:19:42.000Z","dependencies_parsed_at":"2022-08-31T03:01:24.235Z","dependency_job_id":null,"html_url":"https://github.com/TheProfs/defer-script","commit_stats":null,"previous_names":["theprofs/async-script"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fdefer-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fdefer-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fdefer-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheProfs%2Fdefer-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheProfs","download_url":"https://codeload.github.com/TheProfs/defer-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240275923,"owners_count":19775616,"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":["asset-loading","polymer","web-components"],"created_at":"2024-10-11T05:06:19.455Z","updated_at":"2025-12-12T03:49:46.822Z","avatar_url":"https://github.com/TheProfs.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \\\u003cdefer-script\\\u003e\n\n[![Build Status](https://travis-ci.org/TheProfs/defer-script.svg?branch=master)](https://travis-ci.org/TheProfs/defer-script)\n\nLoad deferred scripts that survive vulcanisation/bundling.\n\n## Usage\n\n```bash\n$ bower install --save defer-script\n```\n\n### Basic\n\nIn the below example, `testLib` will be loaded *after* the element is attached,\nregardless if this element was vulcanised/bundled.\n\nIn short, the `src` is not included in any bundles.\n\n```html\n\u003cdefer-script src=\"/lib/test-lib.js\"\u003e\u003c/defer-script\u003e\n```\n\n**Important:** All non-`http`/`https` scripts are passed through\n[`this.resolveUrl()`][resolve-url] to resolve their relative path.\n\n### Multiple scripts\n\nYou can provide multiple `src`'s by separating them with a comma.\n\n```html\n\u003cdefer-script src=\"/lib/foo.js, /lib/bar.js\"\u003e\u003c/defer-script\u003e\n```\n\n### Checking load status\n\nWhen all `src`s have loaded successfully, a `loaded` attribute will be added\nto the element.\n\n```html\n\u003cdefer-script src=\"/lib/foo.js, /lib/bar.js\" loaded\u003e\u003c/defer-script\u003e\n```\n\nThe element will also fire `load`/`error` events where appropriate:\n\n```javascript\n\n// Success, all srcs have loaded\ndocument.querySelector('defer-script').addEventListener('load', () =\u003e {\n  console.log('loaded')\n})\n\n// Error, at least 1 src has failed to load\ndocument.querySelector('defer-script').addEventListener('error', e =\u003e {\n  console.error(e.detail)\n})\n```\n\n## Tests\n\n```\n$ polymer test\n```\n\n## Authors\n\n- [The Profs][the-profs]\n\n## License\n\nMIT License\n\n[resolve-url]: https://www.polymer-project.org/1.0/docs/api/Polymer.Base#method-resolveUrl\n[the-profs]: https://github.com/TheProfs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Fdefer-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheprofs%2Fdefer-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheprofs%2Fdefer-script/lists"}