template-string-engine
v1.0.1
Published
A lightweight template rendering engine with support for expressions, conditionals, loops and date formatting, built for Vue 2 & 3.
Maintainers
Readme
template-string-engine
A lightweight template rendering plugin for Vue 2 & 3.
Features
- Nested field access
{user.name} - JS expression evaluation
{count > 0 ? 'Yes' : 'No'} - Date formatting
{created|y-m-d h:i:s} - Default values
{name ?? 'Anonymous'} - Conditional rendering with
{#if}/{#else}/{#each}
Installation
npm install template-string-engineUsage
import TemplateEngine from 'template-string-engine';
// Then use in your Vue components
const output = TemplateEngine('Hello, {name}', { name: 'only~左岸' });MIT License.
