Repository navigation
Releases: docmd-io/lite-template
Releases · docmd-io/lite-template
Release list
lite-template@0.1.3
Changed
- Bumped
@types/nodefrom 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 auditclean. - 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)
Fixed:
- Resolved an edge-case crash where the native
includehook wouldn't mount for memory/virtual templates (like the Live Editor) when standard file paths were absent. - Injected the standard
"exports"map intopackage.jsonto fixts(2307)module resolution errors in modernNodeNext/BundlerTypeScript environments.
Full Changelog: 0.1.1...0.1.2
lite-template@0.1.1
✨ Added
- Built-in
include()function: lite-template now provides a nativeinclude(name, data?)function for file-based template inclusion — the core EJS feature that was previously missing. Whenoptions.filenameis 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
includefunction indata, 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 threadsoptions.filename: Therender()function previously accepted anoptionsparameter but completely ignored it. Nowoptions.filenameis used for include path resolution and exposed as__filenamein 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): Theoptions.filenameoption is now critical — it enables the built-ininclude()function and sets the base path for relative include resolution.include(name, data?): Available inside templates whenoptions.filenameis set. Auto-appends.ejsextension. Merges parent data with include-specific data.
Full Changelog: 0.1.0...0.1.1
lite-template@0.1.0 🚀 (High-Performance Async Templating)
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
AsyncFunctionobjects, enabling non-blockingawaitlogic 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).