Skip to content

Releases: docmd-io/lite-template

lite-template@0.1.3

Choose a tag to compare

@mgks mgks released this 02 Aug 09:02

Changed

  • Bumped @types/node from 25.5.2 to 25.9.3 (dev dependency).
  • Added a Security Note to the README clarifying the trust model: like EJS, templates are compiled to executable JS, so only render templates you trust.

Notes

  • No runtime changes. npm audit clean.
  • Includes a 1000-iteration brute-fuzz test suite (run npm test).
  • Upgrade: npm install lite-template@0.1.3

Full Changelog: 0.1.2...0.1.3

lite-template@0.1.2 🩹 (Patch Release)

Choose a tag to compare

@mgks mgks released this 04 Apr 22:16

Fixed:

  • Resolved an edge-case crash where the native include hook wouldn't mount for memory/virtual templates (like the Live Editor) when standard file paths were absent.
  • Injected the standard "exports" map into package.json to fix ts(2307) module resolution errors in modern NodeNext/Bundler TypeScript environments.

Full Changelog: 0.1.1...0.1.2

lite-template@0.1.1

Choose a tag to compare

@mgks mgks released this 04 Apr 21:42

✨ Added

  • Built-in include() function: lite-template now provides a native include(name, data?) function for file-based template inclusion — the core EJS feature that was previously missing. When options.filename is set, include() resolves paths relative to the current template, reads the file, and recursively renders it. This makes lite-template usable as a standalone EJS replacement without requiring external patches.
  • Recursive include support: Included templates can themselves call include(), with each level scoped to its own file path for correct relative resolution.
  • Custom include override: If the caller passes their own include function in data, it takes precedence over the built-in version. This allows frameworks (like docmd) to extend include behavior (e.g., adding frontmatter stripping, custom helpers) while users get working includes out of the box.

🐛 Fixed

  • render() now threads options.filename: The render() function previously accepted an options parameter but completely ignored it. Now options.filename is used for include path resolution and exposed as __filename in the template scope.
  • Compilation error debug output: Fixed the error debug logging which used a literal '\\n' instead of an actual newline, making compile error output unreadable.

🔌 API

  • render(template, data, options): The options.filename option is now critical — it enables the built-in include() function and sets the base path for relative include resolution.
  • include(name, data?): Available inside templates when options.filename is set. Auto-appends .ejs extension. Merges parent data with include-specific data.

Full Changelog: 0.1.0...0.1.1

lite-template@0.1.0 🚀 (High-Performance Async Templating)

Choose a tag to compare

@mgks mgks released this 04 Apr 18:30

The debut of lite-template, a modern, async-native template engine built for the ES Module era.

  • Async-First Compilation: Templates are compiled directly into native V8 AsyncFunction objects, enabling non-blocking await logic inside tags.
  • Zero Dependencies: Optimized core logic with absolutely no 3rd-party baggage.
  • EJS Compatible Syntax: Supports common <% ... %>, <%= ... %>, and <%- ... %> tags.
  • Modern Core: Built with TypeScript for the ESM-first ecosystem.
  • Minimal Footprint: Laser-focused on performance (<10KB).