awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
yanhaijing avatar

yanhaijing/template.js

0
View on GitHub↗
1,320 stars·487 forks·JavaScript·MIT·3 views

Template.js

Template.js is a JavaScript template engine designed for parsing and rendering dynamic HTML content in both browser and server-side environments. It functions as a frontend logic library that manages complex user interfaces through data injection, template composition, and extensible rendering logic.

The engine distinguishes itself by prioritizing performance through build-time template compilation, which transforms template files into executable modules or functions to minimize runtime overhead. It also incorporates a secure execution sandbox that restricts template logic to a controlled scope, preventing unauthorized access to the host application context during the rendering process.

The library supports a comprehensive template lifecycle, including syntax parsing, recursive composition of sub-templates, and data transformation via custom filters and decorators. It integrates into standard development workflows through command-line utilities for project scaffolding and plugins for common JavaScript build tools and bundlers.

Features

  • JavaScript Template Engines - Provides a lightweight library for parsing and rendering dynamic HTML content in browser and server environments.
  • Template Compilation Tools - Converts template files into optimized render functions during the build phase.
  • Frontend Logic Basics - Manages complex UI components through nested templates and extensible rendering logic.
  • Build-Time Precompilation - Converts templates into optimized executable JavaScript modules during the build process to minimize runtime overhead.
  • Compiled Template Execution - Compiles template source strings into executable JavaScript functions to maximize rendering performance.
  • Dynamic HTML Generators - Injects data into templates to generate dynamic HTML fragments for web applications.
  • Dynamic Template Rendering - Provides runtime evaluation of templates with dynamic data injection for both browser and server-side environments.
  • Data Filter Extensions - Allows registration of custom functions to manipulate and format data variables before rendering.
  • Template Extensions - Allows the addition of custom logic, directives, and helpers to extend the template engine's capabilities.
  • Template Syntax Parsers - Analyzes template source code to identify and extract logic and placeholders for subsequent rendering or compilation steps.
  • Build Pipeline Plugins - Provides modular plugins to integrate template processing into standard build pipelines.
  • Build Tool Plugins - Provides adapters for common bundlers to precompile templates into executable modules.
  • Template Extensions - Enables developers to extend template functionality with custom logic, filters, and decorators.
  • Template Management Systems - Manages the full lifecycle of templates including parsing, compilation, and rendering across different environments.
  • Build Tool Integrations - Offers plugins for common bundlers to automate template processing within development workflows.
  • Recursive Template Compositions - Enables modular user interface design through the recursive nesting of sub-templates within primary templates.
  • JavaScript Build Engines - Automates template compilation into modules using standard JavaScript build pipelines.
  • Template Modularization - Promotes modular UI design by nesting sub-templates within primary structures.
  • Execution Sandboxes - Restricts template logic execution to prevent unauthorized access to host application contexts.
  • Isolated Execution Sandboxes - Executes template logic within a restricted sandbox to prevent unauthorized access to the host application context.
  • Template Security Policies - Ensures secure rendering by isolating template logic within a restricted execution environment.
  • Abstract Syntax Tree Parsing - Parses template markup into structured trees to enable efficient compilation and rendering.
  • Recursive Template Resolution - Supports recursive inclusion of sub-templates to enable modular and reusable UI component design.
  • Data Transformation Filters - Provides custom filters to transform and format data variables before they are rendered in the final output.
  • Template Logic Customization - Supports registering custom functions and filters to modify data output directly within template syntax.

Star history

Star history chart for yanhaijing/template.jsStar history chart for yanhaijing/template.js

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Curated searches featuring Template.js

Hand-picked collections where Template.js appears.
  • Static site generator

Open-source alternatives to Template.js

Similar open-source projects, ranked by how many features they share with Template.js.
  • olado/dotolado avatar

    olado/doT

    5,043View on GitHub↗

    doT is a compiled JavaScript template engine and rendering system used to generate dynamic text and HTML for both browser-based interfaces and Node.js server-side environments. It transforms template strings into executable JavaScript functions to produce text output across different runtime environments. The system focuses on pre-compiling template source files into standalone JavaScript modules at build time. This process eliminates runtime compilation overhead, increases execution speed, and prevents malicious code injection. The engine supports logic-based interpolation using conditional

    JavaScript
    View on GitHub↗5,043
  • wycats/handlebars.jswycats avatar

    wycats/handlebars.js

    18,651View on GitHub↗

    Handlebars.js is a JavaScript templating engine used to generate HTML and other text formats by combining static templates with dynamic data. It functions as a logic-less template engine, separating presentation from business logic by restricting the complexity of expressions within templates. The project includes a precompiled template compiler that converts template strings into executable JavaScript functions. This mechanism reduces runtime overhead and improves rendering performance by shifting the compilation process to a build step. The engine provides a custom helper framework for ext

    JavaScript
    View on GitHub↗18,651
  • shopify/liquidShopify avatar

    Shopify/liquid

    11,811View on GitHub↗

    Liquid is a secure template engine and markup language used to generate dynamic HTML or text by combining static templates with backend data. It functions as a web template renderer that transforms markup into final output while restricting available logic to prevent arbitrary code execution. The engine focuses on secure markup execution, providing a restricted environment where user-provided templates cannot access sensitive system data. It utilizes a safe evaluation sandbox to ensure that only a predefined set of instructions can be executed. The system includes capabilities for template s

    Ruby
    View on GitHub↗11,811
  • tj/ejstj avatar

    tj/ejs

    4,461View on GitHub↗

    ejs is an embedded JavaScript template engine for Node.js that generates HTML and other text formats by embedding JavaScript logic into templates. It functions as a server-side rendering engine and HTML template processor that merges static markup with dynamic data. The system operates as a compiled template library, converting templates into JavaScript functions to enable cached rendering and faster execution. It includes built-in security to prevent cross-site scripting by automatically escaping HTML entities and special characters during the rendering process. The engine supports modular

    JavaScript
    View on GitHub↗4,461
See all 30 alternatives to Template.js→

Frequently asked questions

What does yanhaijing/template.js do?

Template.js is a JavaScript template engine designed for parsing and rendering dynamic HTML content in both browser and server-side environments. It functions as a frontend logic library that manages complex user interfaces through data injection, template composition, and extensible rendering logic.

What are the main features of yanhaijing/template.js?

The main features of yanhaijing/template.js are: JavaScript Template Engines, Template Compilation Tools, Frontend Logic Basics, Build-Time Precompilation, Compiled Template Execution, Dynamic HTML Generators, Dynamic Template Rendering, Data Filter Extensions.

What are some open-source alternatives to yanhaijing/template.js?

Open-source alternatives to yanhaijing/template.js include: olado/dot — doT is a compiled JavaScript template engine and rendering system used to generate dynamic text and HTML for both… wycats/handlebars.js — Handlebars.js is a JavaScript templating engine used to generate HTML and other text formats by combining static… shopify/liquid — Liquid is a secure template engine and markup language used to generate dynamic HTML or text by combining static… tj/ejs — ejs is an embedded JavaScript template engine for Node.js that generates HTML and other text formats by embedding… vuejs/v2.vuejs.org — This is the comprehensive documentation website for the Vue 2 progressive JavaScript framework. It serves as a… lunet-io/scriban — Scriban is a .NET text templating engine and embedded scripting language used for dynamic text generation. It…