{"id":22792125,"url":"https://github.com/blankeos/tsdot","last_synced_at":"2025-07-19T17:05:08.819Z","repository":{"id":266781426,"uuid":"899338293","full_name":"Blankeos/tsdot","owner":"Blankeos","description":"⚡️ The fastest + concise javascript template engine for Node.js and browsers. Forked from doT.","archived":false,"fork":false,"pushed_at":"2024-12-26T19:41:04.000Z","size":218,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T15:18:59.923Z","etag":null,"topics":["dot","dotjs","handlebars","template-engine","templating","templating-language"],"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/Blankeos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-12-06T04:12:39.000Z","updated_at":"2024-12-26T19:32:32.000Z","dependencies_parsed_at":"2024-12-06T05:20:58.233Z","dependency_job_id":"aaf33be1-76dd-43d6-adcb-386f02a7089d","html_url":"https://github.com/Blankeos/tsdot","commit_stats":null,"previous_names":["blankeos/dot.js"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Ftsdot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Ftsdot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Ftsdot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blankeos%2Ftsdot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blankeos","download_url":"https://codeload.github.com/Blankeos/tsdot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251729733,"owners_count":21634281,"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":["dot","dotjs","handlebars","template-engine","templating","templating-language"],"created_at":"2024-12-12T03:09:37.003Z","updated_at":"2025-07-19T17:05:08.810Z","avatar_url":"https://github.com/Blankeos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![dot.js](https://raw.githubusercontent.com/Blankeos/tsdot/refs/heads/main/_docs/banner.png)\n\n\u003ch1 align=\"center\"\u003etsdot\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n        \u003ca href=\"https://www.npmjs.com/package/tsdot\" target=\"_blank\"\u003e\n          \u003cimg src=\"https://img.shields.io/npm/dw/tsdot?style=for-the-badge\" alt=\"NPM Downloads\"\u003e\u003c/img\u003e\u003c/a\u003e\n        \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/tsdot?style=for-the-badge\" alt=\"NPM Bundle Size\" \u003e\u003c/img\u003e\n          \u003cimg src=\"https://img.shields.io/badge/maintained%20with-bun-cc00ff.svg?style=for-the-badge\u0026logo=bun)](https://bun.sh/\" alt=\"Bun\"\u003e\u003c/img\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/vike-metadata-react?style=for-the-badge\" alt=\"NPM License\"\u003e\u003c/img\u003e\n\u003c/div\u003e\n\ntsdot is a template engine for JavaScript. It is similar to Mustache, EJS, Handlebars, and many others. This is a fork of the original [doT.js](https://github.com/olado/doT) template engine.\n\n## Features\n\n- 🔥 Super fast and super small\n- ⚡️ Compile-time valuation\n- ❇️ Custom delimiters, partials, conditionals, array iterators, encoding, white-space control, and much more.\n\nThe only new changes after the fork are:\n\n- 🚀 First-class typescript support (more modern wow!)\n- 💪 Works in the Browser, Node.js Bun, and Deno.\n- 🤓 Better Docs :D (no, really)\n- 🥳 More fun! (wow emojies)\n\n## Installation\n\n### JS/TS Projects\n\n```sh\nnpm install tsdot\n```\n\n### Browser-only\n\n```html\n\u003chead\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/tsdot@latest/dist/index.global.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n```\n\n## Basic Usage\n\n### JS/TS Projects\n\n```ts\nimport tsdot from \"tsdot\";\n\nconst template = `\n  \u003cdiv class=\"container\"\u003e\n    \u003ch1\u003eHello, {{=it.name}}!\u003c/h1\u003e\n  \u003c/div\u003e\n`;\n\n// 1. Compile the template\nconst compiledTemplate = tsdot.compile(template);\n\n// 2. Render the template with data\nconst result = compiledTemplate({ name: \"World\" });\n\n// \u003cdiv class=\"container\"\u003e\n//   \u003ch1\u003eHello, World!\u003c/h1\u003e\n// \u003c/div\u003e\n```\n\n### Browser-only\n\n```html\n\u003cbody\u003e\n  \u003cscript\u003e\n    const template = `\n        \u003cdiv class=\"container\"\u003e\n          \u003ch1\u003eHello, {{=it.name}}!\u003c/h1\u003e\n        \u003c/div\u003e\n      `;\n\n    const compiledTemplate = tsdot.compile(template);\n\n    // 2. Render the template with data\n    const result = compiledTemplate({ name: \"World\" });\n  \u003c/script\u003e\n\u003c/body\u003e\n```\n\n## Reference\n\n\u003e [!WARNING]\n\u003e\n\u003e Work in progress, feel free to contribute a PR for examples/code snippets.\n\n### Templating Language\n\n\u003e I think each of these need examples.\n\n```\n{{  }} - evaluation\n{{=  }} - interpolation\n{{! }} - interpolation with encoding # Does not work it seems.\n{{# }} - compile-time evaluation/includes and partials\n{{## #}} - compile-time defines\n{{? }} - conditionals\n{{~ }} - array iteration\n```\n\n### TypeScript API\n\n```ts\n// Compiles a template.\n// - `tmpl`: The template string.\n// - `c`: The template settings.\n// - `def`: The template default values. (I think)\nDot.template\u003cT\u003e(tmpl: string, c?: TemplateSettings | null, def?: Record\u003cstring, any\u003e): RenderFunction\u003cT\u003e\n\n// Function returned by Dot.template(). Use this to render the template.\nRenderFunction\u003cT = Record\u003cstring, any\u003e\u003e = (data: T): string // Function returned by Dot.template(). Use this to render the template.\n\n// For express apparently.\nDot.compile(tmpl: string, def?: Record\u003cstring, any\u003e): RenderFunction\n```\n\n### Credits\n\n- [doT.js](https://olado.github.io/doT/index.html) - Original by by Laura Doktorova. However, it's been super outdated and I couldn't install it properly without TypeScript complaining hard. Hence, motivated this fork with better tools like tsup nowadays.\n- [Handlebars](https://handlebarsjs.com/guide/) - OG templating with great devx.\n- [Mustache](https://mustache.github.io/) - Logic-less templates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Ftsdot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblankeos%2Ftsdot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblankeos%2Ftsdot/lists"}