{"id":19290503,"url":"https://github.com/jacob-ebey/html-tagged","last_synced_at":"2025-06-26T06:36:01.259Z","repository":{"id":82848225,"uuid":"587013854","full_name":"jacob-ebey/html-tagged","owner":"jacob-ebey","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-26T07:19:58.000Z","size":440,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T05:03:41.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://html-tagged.deno.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacob-ebey.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-09T19:00:51.000Z","updated_at":"2024-07-02T17:42:22.000Z","dependencies_parsed_at":"2024-12-12T00:11:40.838Z","dependency_job_id":"8004ecb8-cec1-401f-8c36-d6d5ce0f27e8","html_url":"https://github.com/jacob-ebey/html-tagged","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.17021276595744683","last_synced_commit":"0341a23b87722c65a165c8cde534428ab4fedcdb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jacob-ebey/html-tagged","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ebey%2Fhtml-tagged","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ebey%2Fhtml-tagged/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ebey%2Fhtml-tagged/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ebey%2Fhtml-tagged/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacob-ebey","download_url":"https://codeload.github.com/jacob-ebey/html-tagged/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ebey%2Fhtml-tagged/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261814338,"owners_count":23213802,"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-11-09T22:19:28.014Z","updated_at":"2025-06-26T06:36:01.225Z","avatar_url":"https://github.com/jacob-ebey.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-tagged\n\nA SSR template library that expands custom elements. Inspired by\n[@enhance/ssr](https://npmjs.com/package/@enhance/ssr).\n\n## Usage\n\n```js\nimport { attr, html } from \"html-tagged\";\nimport { renderToString } from \"html-tagged/server\";\n\nconst elements = {\n  \"my-element\": ({ attrs }) =\u003e\n    html`\u003cdiv class=\"my-element\" data-name=${attr(attrs.name)}\u003e\n\t\t\t\u003cslot\u003e\u003c/slot\u003e\n\t\t\u003c/div\u003e`,\n};\n\nconst template = html`\u003cmy-element name=\"test\"\u003eHello World!\u003c/my-element\u003e`;\nconst htmlString = renderToString(template, { elements });\nconsole.log(htmlString);\n```\n\nwill output:\n\n```html\n\u003cmy-element name=\"test\"\u003e\n\t\u003cdiv class=\"my-element\" data-name=\"test\"\u003eHello World!\u003c/div\u003e\n\u003c/my-element\u003e\n```\n\n## Performance\n\nThe performance mainly comes from the fact this library does not fully parse the\ninput HTML, but instead parses just what's needed for the functionality this\nlibrary provides. This means that the library is not a full HTML parser, and it\nwill not be able to parse HTML that is not valid for the functionality this\nlibrary provides.\n\nFor a basic \"hello world\" page:\n\n| Library      | Ops/sec |\n| ------------ | ------- |\n| @enhance/ssr | 64867   |\n| html-tagged  | 256122  |\n\nFor the Oven-sh's Bun HUGE README (7630 lines):\n\n| Library      | Ops/sec |\n| ------------ | ------- |\n| @enhance/ssr | 47      |\n| html-tagged  | 306     |\n\n## Development\n\nTesting in Deno can be ran in a single pass with:\n\n```sh\ndeno test -A\n```\n\nOr in watch mode with:\n\n```sh\ndeno test -A --watch\n```\n\nFormat code with:\n\n```sh\ndeno task format\n```\n\nTypecheck / lint code with:\n\n```sh\ndeno task check\n```\n\n## Contributing Changes\n\nInstall CLI:\n\n```sh\nnpm i -g @changesets/cli\n```\n\nGenerate changeset:\n\n```sh\nnpx changeset\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-ebey%2Fhtml-tagged","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacob-ebey%2Fhtml-tagged","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-ebey%2Fhtml-tagged/lists"}