Skip to content

vvenv/janja

Repository files navigation

The Reeds
Tr. ZHAO Yanchun

The reeds sway, green and green;
The white dew becomes frost.
The lady fair I mean
Looms yonder, all but lost.
Upstream to her I row;
The course is long and high.
Upstream to her I go;
On the waves she looks shy.

The reeds sway, clean and clean;
The white dew has not dried.
The lady fair I mean
Looms by the riverside.
Upstream to her I row;
The course is hard and high.
Upstream to her I go;
On the strand she seems nigh.

The reeds sway, sheen and sheen;
The white dew as e’er gleams.
The lady fair I mean
Stands on the bank, it seems.
Upstream to her I row;
The course turns left and right.
Upstream to her I go;
On the shoal she beams bright.

Janja

A simple, fast, lightweight, and extensible template engine for Node.js and browsers.

test

中文

Key Features

  • 📝 Intuitive template syntax: Simple syntax for variables, conditionals, and loops.
  • 🔄 Layout and partials: Supports template inheritance and reusable components.
  • 🛠️ Built-in directives and filters: A collection of built-in directives and filters.
  • 🎨 Custom directives and filters: Ability to define custom directives and filters.
  • 🚀 Pre-compilation: Enhance rendering performance by precompiling.
  • 🐛 Error handling and debugging: Provides detailed error reporting and debugging support.
  • 🛡️ Security: Automatic escaping.
  • 🛫 Asynchronous data loading: Supports fetching and displaying remote data asynchronously.
  • 🌐 Universal compatibility: Works in both Node.js and browser environments.
  • 📦 Zero dependencies: Lightweight with no external dependencies.

Play Online

StackBlitz

Getting Started

import { render } from 'janja'

document.body.innerHTML = await render('Hello, {{= name }}!', { name: 'World' })

or

import { renderFile } from 'janja'

document.body.innerHTML = await renderFile('./template.html', { name: 'World' })

Documentation

License

Janja is released under the MIT License. You are free to use, modify, and distribute it as long as you comply with the license terms.