{"id":19142247,"url":"https://github.com/eldoy/htmlview","last_synced_at":"2026-06-11T23:31:43.799Z","repository":{"id":57268027,"uuid":"462643021","full_name":"eldoy/htmlview","owner":"eldoy","description":"HTML view template string function","archived":false,"fork":false,"pushed_at":"2023-06-19T11:10:04.000Z","size":787,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-22T09:06:09.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/eldoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-02-23T08:20:41.000Z","updated_at":"2022-06-04T21:51:32.000Z","dependencies_parsed_at":"2024-11-09T07:29:01.871Z","dependency_job_id":"513cd76b-d5c9-49df-ac79-68218044be8b","html_url":"https://github.com/eldoy/htmlview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eldoy/htmlview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fhtmlview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fhtmlview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fhtmlview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fhtmlview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/htmlview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fhtmlview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34222709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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-11-09T07:26:31.005Z","updated_at":"2026-06-11T23:31:43.776Z","avatar_url":"https://github.com/eldoy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML View\n\nHTML view template string function.\n\nThis is a convenience function for creating HTML with Javascript.\n\n### Install\n\nIn the browser, grab one of the files from the `dist` folder in this repository.\n\n```\nnpm i htmlview\n```\n\n### Usage\n\n```js\n// For usage with NodeJS only\nconst h = require('htmlview')\n\n// HTML string, just like normal template string\nconst html = h`\u003cdiv\u003ehello\u003c/div\u003e`\n// \u003cdiv\u003ehello\u003c/div\u003e\n\n// HTML string with variables, like normal\nconst html = h`\u003cdiv\u003ehello ${5}\u003c/div\u003e`\n// \u003cdiv\u003ehello 5\u003c/div\u003e\n\n// Automatically joins array variables\nconst html = h`\u003cdiv\u003ehello ${[ '1', '2', '3']}\u003c/div\u003e`\n// \u003cdiv\u003ehello 123\u003c/div\u003e\n\n// Avoid automatically joining array variables\nconst html = h`\u003cdiv\u003ehello ${[ '1', '2', '3'].join(',')}\u003c/div\u003e`\n// \u003cdiv\u003ehello 1,2,3\u003c/div\u003e\n\n// Automatically calls functions\nconst html = h`\u003cdiv\u003ehello ${() =\u003e 'bye'}\u003c/div\u003e`\n// \u003cdiv\u003ehello bye\u003c/div\u003e\n\n// Returns empty string by default, not 'undefined'\nconst html = h`\u003cdiv\u003ehello${() =\u003e {\n  if (project.done) return '\u003cb\u003ebye\u003c/b\u003e'\n}}\u003c/div\u003e`\n// \u003cdiv\u003ehello\u003c/div\u003e\n```\n\nMIT Licensed. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fhtmlview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Fhtmlview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fhtmlview/lists"}