Hacker News

Show HN: Templon – A strict, modern template string engine for JavaScript/TS

Hacker News - Sat, 04/26/2025 - 2:02am

Hi HN,

I built [Templon](https://github.com/amirfarzamnia/templon), a lightweight template string engine for JavaScript and TypeScript.

It’s designed to solve a simple but surprisingly messy problem: safely replacing placeholders in a string, with features you usually have to hack together yourself.

Templon supports: - Deep variable access (`{{user.name}}`) - Custom delimiters - Escape characters for literal brackets - Strict mode (error if missing keys) - Circular reference protection - Full TypeScript types

It’s useful when you want more than `string.replace`, but don’t need a full EJS/Handlebars engine.

I was frustrated by older libraries like `string-template` not supporting nested objects or strict validation, and wanted something modern, strict, and flexible.

Repo: https://github.com/amirfarzamnia/templon

Would love feedback — good, bad, brutal. Thanks!

Comments URL: https://news.ycombinator.com/item?id=43801305

Points: 1

# Comments: 0

Categories: Hacker News

I help founders improve their AI SEO ranking

Hacker News - Sat, 04/26/2025 - 1:45am

Article URL: https://www.lm-seo.com/

Comments URL: https://news.ycombinator.com/item?id=43801221

Points: 1

# Comments: 0

Categories: Hacker News

Cloth

Hacker News - Sat, 04/26/2025 - 1:31am
Categories: Hacker News

Pages