{"id":31940348,"url":"https://github.com/dsnchz/solid-create-script","last_synced_at":"2026-03-10T19:30:54.591Z","repository":{"id":264120711,"uuid":"892400074","full_name":"dsnchz/solid-create-script","owner":"dsnchz","description":"Solid hook to dynamically load an external script","archived":false,"fork":false,"pushed_at":"2025-06-05T16:51:05.000Z","size":327,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T12:39:59.743Z","etag":null,"topics":["load-script","script","script-loader","solidjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/dsnchz.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-22T03:21:42.000Z","updated_at":"2025-06-11T13:46:00.000Z","dependencies_parsed_at":"2024-11-22T07:00:08.331Z","dependency_job_id":"3ddd8720-f4f0-4d2e-a018-9bba8ffffa66","html_url":"https://github.com/dsnchz/solid-create-script","commit_stats":null,"previous_names":["thedanchez/solid-create-script","dsnchz/solid-create-script"],"tags_count":11,"template":false,"template_full_name":"thedanchez/template-solidjs-library","purl":"pkg:github/dsnchz/solid-create-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-create-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-create-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-create-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-create-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsnchz","download_url":"https://codeload.github.com/dsnchz/solid-create-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-create-script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30350017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["load-script","script","script-loader","solidjs"],"created_at":"2025-10-14T08:52:59.419Z","updated_at":"2026-03-10T19:30:54.573Z","avatar_url":"https://github.com/dsnchz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=Ecosystem\u0026background=tiles\u0026project=solid-create-script\" alt=\"solid-create-script\"\u003e\n\u003c/p\u003e\n\n# @dschz/solid-create-script\n\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n[![npm](https://img.shields.io/npm/v/@dschz/solid-create-script)](https://www.npmjs.com/package/@dschz/solid-create-script)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dschz/solid-create-script)](https://bundlephobia.com/package/@dschz/solid-create-script)\n[![JSR](https://jsr.io/badges/@dschz/solid-create-script/score)](https://jsr.io/@dschz/solid-create-script)\n[![CI](https://github.com/dsnchz/solid-create-script/actions/workflows/ci.yaml/badge.svg)](https://github.com/dsnchz/solid-create-script/actions/workflows/ci.yaml)\n\n\u003e SolidJS hook to load external scripts -- built on top of [`@dschz/load-script`](https://www.npmjs.com/package/@dschz/load-script).\n\n## ✅ Features\n\n- 📑 Fully typed with TypeScript\n- ✏️ Built on top of [`@dschz/load-script`](https://www.npmjs.com/package/@dschz/load-script) inheriting all the same features.\n- 📆 Declarative async tracking via Solid's `createResource`\n\n## 📦 Installation\n\n```bash\nnpm install solid-js @dschz/load-script @dschz/solid-create-script\npnpm install solid-js @dschz/load-script @dschz/solid-create-script\nyarn install solid-js @dschz/load-script @dschz/solid-create-script\nbun install solid-js @dschz/load-script @dschz/solid-create-script\n```\n\n\u003e These are **peer dependencies**, so you must install:\n\u003e\n\u003e - `solid-js`\n\u003e - `@dschz/load-script`\n\n## 🧠 API\n\n### `createScript(src, options?, container?)`\n\nLoads an external script dynamically and returns a `Resource\u003cHTMLScriptElement\u003e`.\n\n#### Parameters:\n\n| Name        | Type                | Description                                                       |\n| ----------- | ------------------- | ----------------------------------------------------------------- |\n| `src`       | `string`            | Script URL (required)                                             |\n| `options`   | `LoadScriptOptions` | `loadScript` options (e.g. `async`, `type`)                       |\n| `container` | `HTMLElement`       | HTML element to append `\u003cscript /\u003e` to (default: `document.head`) |\n\n## 🧪 Example\n\n```ts\nimport { Switch, Match } from \"solid-js\";\nimport { createScript } from \"@dschz/solid-create-script\";\n\nconst CustomComponent = () =\u003e {\n  const script = createScript(\"https://example.com/widget.js\", { async: true });\n\n  return (\n    \u003cSwitch\u003e\n      \u003cMatch when={script.loading}\u003eLoading Script...\u003c/Match\u003e\n      \u003cMatch when={script.error}\u003eFailed to load\u003c/Match\u003e\n      \u003cMatch when={script()}\u003eScript is ready!\u003c/Match\u003e\n    \u003c/Switch\u003e\n  );\n};\n```\n\n## 📝 Notes\n\n- Scripts are cached by `src` unless `innerHTML` or `textContent` is used\n- Scripts are not automatically removed on cleanup/unmount\n- Designed to be simple and safe to use inside SolidJS components (in SSR and non-SSR environments)\n\n## 💬 Feedback \u0026 Contributions\n\nFeel free to open [issues](https://github.com/dsnchz/solid-create-script/issues) or submit pull requests. PRs are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnchz%2Fsolid-create-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsnchz%2Fsolid-create-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnchz%2Fsolid-create-script/lists"}