UNPKG

@amho/ash-template-engine

Version:

I built my own template engine for learning purposes with zero dependencies in TypeScript - It's called Ash

12 lines (7 loc) 424 B
import { TemplateEngine } from '../../src'; import { dataNested } from '../shared'; const template = 'This {{ dataNested.category }} has {{ dataNested.specs.engine.type }} with {{ dataNested.specs.engine.hp }} horsepower, and {{ dataNested.specs.doors }} doors.'; const templateEngine = TemplateEngine.createWithMustacheSyntax(); const result = templateEngine.compile(template, { dataNested }); console.log(result);