{"id":20755214,"url":"https://github.com/formix/templater","last_synced_at":"2026-04-28T04:01:29.879Z","repository":{"id":84235181,"uuid":"59029657","full_name":"formix/templater","owner":"formix","description":"Template any text file using Javascript","archived":false,"fork":false,"pushed_at":"2018-05-09T15:05:24.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T13:14:12.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/formix.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":"2016-05-17T14:25:34.000Z","updated_at":"2018-05-09T15:05:25.000Z","dependencies_parsed_at":"2023-05-24T02:15:41.877Z","dependency_job_id":null,"html_url":"https://github.com/formix/templater","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/formix/templater","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Ftemplater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Ftemplater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Ftemplater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Ftemplater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formix","download_url":"https://codeload.github.com/formix/templater/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Ftemplater/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32365519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"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-17T09:23:52.359Z","updated_at":"2026-04-28T04:01:29.841Z","avatar_url":"https://github.com/formix.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"templater\n=========\n\nTemplate absolutely any text file using this simple ASP like Javascript \ntemplating engine.\n\n## Usage\n\n### Without model\n\n```C#\n    var template = new Template(\"Templates/github-example.txt\");\n    template.Render(Console.Out);  // writes to any TextWriter\n```\n\n### With a model\n\nYou can render using a model. The `model` object is then available to the \nscript.\n\n```C#\n    var template = new Template(\"Templates/github-example.txt\");\n    template.Render(Console.Out, new {\n        FirstName = \"John\",\n        LastName = \"Doe\",\n        Age = 30\n    });\n```\n\nWhen the render method is called for the first time, the template is compiled \nto a script that is reused if further calls to `Render` is made with different \nmodels.\n\nThe `output` object is the `System.IO.TextWriter` that is passed to the \n`Render` method.\n\n## Template example\n\n*github-example.txt*\n```ASP\n\u003c%\n    var x = 5 * 3;\n%\u003e\nThe result is: '\u003c% =x %\u003e'\n\n\u003c% for (var i = 0; i \u003c 3; i++) { %\u003e\nHello for the \u003c%\n    if (i === 0) {\n        output.Write(\"first\");\n    } else if (i === 1) {\n        output.Write(\"second\");\n    } else if (i === 2) {\n        output.Write(\"third\");\n    }\n%\u003e time! \u003c% \n} %\u003e\n\nThanks\n```\n\nThis will produce the following text file:\n\n```\n\nThe result is: '15'\n\n\nHello for the first time! \nHello for the second time! \nHello for the third time! \n\nThanks\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Ftemplater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformix%2Ftemplater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Ftemplater/lists"}