Skip to content

vvenv/janja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

177 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.
  • 🚀 High performance: LRU cache for compiled templates, pre-compilation support, and optimized string processing.
  • 🛡️ Enhanced security: Sandbox mode, CSP support, deep escaping, and security audit tools.
  • 📊 Rich filter library: Date/time, number formatting, text processing, array manipulation, object transformation, and async filters.
  • 🐛 Error handling and debugging: Provides detailed error reporting and debugging support.
  • 🛫 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.