{"id":23752766,"url":"https://github.com/ziv/any-src","last_synced_at":"2025-08-09T03:10:54.471Z","repository":{"id":57180893,"uuid":"337780958","full_name":"ziv/any-src","owner":"ziv","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-17T17:23:13.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-01T18:09:37.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/ziv.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}},"created_at":"2021-02-10T16:20:56.000Z","updated_at":"2021-03-17T17:23:15.000Z","dependencies_parsed_at":"2022-09-14T03:40:44.409Z","dependency_job_id":null,"html_url":"https://github.com/ziv/any-src","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ziv/any-src","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fany-src","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fany-src/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fany-src/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fany-src/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziv","download_url":"https://codeload.github.com/ziv/any-src/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziv%2Fany-src/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518403,"owners_count":24430621,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"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-12-31T17:55:39.495Z","updated_at":"2025-08-09T03:10:54.449Z","avatar_url":"https://github.com/ziv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# any-src\nSimple web-component provide `src` attribute to enrich HTML templates.\n\nThe package export only single component `any-src`. \nAll options and configuration done using HTML5 `data-*` attributes.\n\n## Usage\n```shell\nnpm i any-src\n```\n\n## API\n### Component Attributes\n\n| Attribute | Description |\n| --- | --- |\n| `src` | URL to load |\n| `opts` | [fetch](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters) options `JSON` |\n\n\n### Content Attributes\n\n| Attribute | Description |\n| --- | --- |\n| `data-text` | Set `innerText` of element |\n| `data-src` | Set `src` of element |\n| `data-value` | Set `value` of element |\n\n\n## Example\n### Data source\nThe following `JSON` available at `/data.json` end-point.\n```json\n{\n  \"sample\": \"Sample text\",\n  \"numeric\": 120,\n  \"image\": \"https://picsum.photos/100/100\"\n}\n```\n\n### HTML\n```html\n\u003cany-src src=\"https://example/data.json\"\u003e\n    \u003cp data-text=\"sample\"\u003e\u003c/p\u003e\n    \u003cimg data-src=\"image\"\u003e\n    \u003cdiv\u003e\n        \u003cinput type=\"number\" data-value=\"numeric\"\u003e\n    \u003c/div\u003e\n\u003c/any-src\u003e\n```\n\n## TODO\n* HTTP options for the fetch function\n* loader support\n* error handling?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziv%2Fany-src","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziv%2Fany-src","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziv%2Fany-src/lists"}