{"id":20638573,"url":"https://github.com/fengyuanchen/load-scripts","last_synced_at":"2025-04-15T21:52:45.031Z","repository":{"id":66161631,"uuid":"129103733","full_name":"fengyuanchen/load-scripts","owner":"fengyuanchen","description":"Dynamic scripts loading for modern browsers.","archived":false,"fork":false,"pushed_at":"2021-09-21T06:11:02.000Z","size":107,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T01:51:45.528Z","etag":null,"topics":["browser","loader","promise","script"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/load-scripts","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/fengyuanchen.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}},"created_at":"2018-04-11T14:08:02.000Z","updated_at":"2024-12-18T19:51:36.000Z","dependencies_parsed_at":"2023-02-21T02:16:15.738Z","dependency_job_id":null,"html_url":"https://github.com/fengyuanchen/load-scripts","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"4559e7483f6157113cabec2fee19087c20f139ed"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengyuanchen%2Fload-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengyuanchen%2Fload-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengyuanchen%2Fload-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fengyuanchen%2Fload-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fengyuanchen","download_url":"https://codeload.github.com/fengyuanchen/load-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589897,"owners_count":21129700,"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":["browser","loader","promise","script"],"created_at":"2024-11-16T15:18:32.955Z","updated_at":"2025-04-15T21:52:45.008Z","avatar_url":"https://github.com/fengyuanchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# load-scripts\n\n[![Downloads](https://img.shields.io/npm/dm/load-scripts.svg)](https://www.npmjs.com/package/load-scripts) [![Version](https://img.shields.io/npm/v/load-scripts.svg)](https://www.npmjs.com/package/load-scripts) [![Gzip Size](https://img.shields.io/bundlephobia/minzip/load-scripts.svg)](https://unpkg.com/load-scripts/dist/load-scripts.js)\n\n\u003e Dynamic scripts loading for modern browsers.\n\n## Main files\n\n```text\ndist/\n├── load-scripts.js         (UMD, default)\n├── load-scripts.min.js     (UMD, compressed)\n├── load-scripts.esm.js     (ECMAScript Module)\n├── load-scripts.esm.min.js (ECMAScript Module, compressed)\n└── load-scripts.d.ts       (TypeScript Declaration File)\n```\n\n## Getting started\n\n### Installation\n\n```shell\nnpm install load-scripts\n```\n\nIn browser:\n\n```html\n\u003cscript src=\"/path/to/load-scripts.js\"\u003e\u003c/script\u003e\n```\n\n### Usage\n\n#### Syntax\n\n```js\nloadScripts(script1, script2, ..., scriptN)\n  .then(() =\u003e {})\n  .catch((err) =\u003e {})\n  .finally(() =\u003e {});\n```\n\n#### Example\n\n```js\nimport loadScripts from 'load-scripts';\n\nloadScripts('foo.js').then(() =\u003e {\n  console.log(window.Foo);\n});\n\nloadScripts('foo.js', 'bar.js').then(() =\u003e {\n  console.log(window.Foo, window.Bar);\n});\n```\n\nIn browser:\n\n```html\n\u003cscript\u003e\n  loadScripts('foo.js').then(() =\u003e {\n    console.log(window.Foo);\n  });\n\u003c/script\u003e\n```\n\n## Browser support\n\n- Chrome (latest)\n- Firefox (latest)\n- Safari (latest)\n- Opera (latest)\n- Edge (latest)\n- Internet Explorer 10+ (requires a `Promise` polyfill as [es6-promise](https://github.com/stefanpenner/es6-promise))\n\n## Versioning\n\nMaintained under the [Semantic Versioning guidelines](https://semver.org/).\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengyuanchen%2Fload-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffengyuanchen%2Fload-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffengyuanchen%2Fload-scripts/lists"}