Skip to content

templeoNative template literals, compiled for reuse

A zero-dependency JavaScript template engine with portable renderers, nested includes, debugging, and extensible caching.

templeo

templeo ​

templeo is a zero-dependency template engine that uses built-in JavaScript/ECMAScript Template Literals. There is no regular-expression parser or special template syntaxβ€”just native ES template literals.

For more details, see The Basics, Cache, Examples, and the API Reference.

Features ​

  • πŸ’―% PURE β€” No special syntax is required. Everything is part of the ECMAScript Template Literals specification, and a single Engine can output HTML, DOM nodes, JSON, YAML, or virtually any other format.
  • 🌱 Grows with the language β€” New template literal syntax and language features are immediately usable without a templeo parser update.
  • 🌐 Stand-Alone Rendering β€” Once compiled, a rendering function no longer depends on templeo internals and can be serialized, deserialized, or served from another source.
  • πŸ›‘οΈ Secure β€” Compilation is sandboxed from local scope, and portable renderers remain isolated from the scope in which they were compiled.
  • ⛓️ Parameterized/Nested Includes β€” Reusable partials can be included at compile time or render time, with parameters confined to the included partial.
  • 🐞 Debugging β€” Compiled templates remain accessible through VM sourceURL values or module imports/requires for direct debugging.
  • 🧠 Extensible β€” Register helper functions for use in template literal expressions, while rendered output remains independent of templeo.
  • πŸ›ŽοΈ Auto Fetch β€” Templates, partials, and context can be fetched automatically at compile time or render time from HTTP/S sources.
  • 🏧 Caching β€” Templates are cached in memory by default. Bundled extensions support IndexedDB/LevelDB and the Node.js file system.

Released under the MIT License.