{"id":15361527,"url":"https://github.com/jonathanong/load-script","last_synced_at":"2025-06-28T17:08:15.353Z","repository":{"id":65995835,"uuid":"124249927","full_name":"jonathanong/load-script","owner":"jonathanong","description":"Script loader with promise \u0026 requestIdleCallback support","archived":false,"fork":false,"pushed_at":"2020-03-29T04:38:12.000Z","size":61,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-01T08:26:16.521Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-03-07T14:44:27.000Z","updated_at":"2023-03-04T06:17:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"d10f771c-13f5-420a-9d23-9ba895aecdf0","html_url":"https://github.com/jonathanong/load-script","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.09999999999999998,"last_synced_commit":"082b85f9bf851d1b9ab9c64113d9fae930a5a911"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jonathanong/load-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fload-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fload-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fload-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fload-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanong","download_url":"https://codeload.github.com/jonathanong/load-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanong%2Fload-script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262465785,"owners_count":23315641,"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":[],"created_at":"2024-10-01T12:55:31.027Z","updated_at":"2025-06-28T17:08:15.327Z","avatar_url":"https://github.com/jonathanong.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# @jongleberry/load-script\n\n[![Build Status](https://travis-ci.org/jonathanong/load-script.svg?branch=master)](https://travis-ci.org/jonathanong/load-script)\n[![codecov](https://codecov.io/gh/jonathanong/load-script/branch/master/graph/badge.svg)](https://codecov.io/gh/jonathanong/load-script)\n[![Greenkeeper badge](https://badges.greenkeeper.io/jonathanong/load-script.svg)](https://greenkeeper.io/)\n\nScript loader with:\n\n- `Promise` support\n- `requestIdleCallback` support\n\nInstallation:\n\n```bash\nnpm install --save-dev @jongleberry/load-script\n```\n\nExample:\n\n```js\nimport loadScript from '@jongleberry/load-script'\n\nloadScript('https://www.googletagmanager.com/ns.html?id=GTM-XXXX', {\n  timeout: 1000\n}).catch((err) =\u003e {\n  console.error(err.stack)\n})\n```\n\n## API\n\n### const script = await loadScript(src [, options])\n\n- `src` - JS source URL\n- `options`:\n  - `type`\n  - `charset`\n  - `id`\n  - `noModule`\n  - `async`\n  - `defer`\n  - `timeout` - timeout passed to `requestIdleCallback`, falling back to `setTimeout`. Set to 0 to load JS in at least the next tick.\n\nReturns the script element when it's resolved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fload-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanong%2Fload-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanong%2Fload-script/lists"}