# tj/ejs

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tj-ejs).**

4,461 stars · 496 forks · JavaScript

## Links

- GitHub: https://github.com/tj/ejs
- awesome-repositories: https://awesome-repositories.com/repository/tj-ejs.md

## Description

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 design through the use of partial templates, allowing for the insertion of reusable interface components into larger page structures. It also provides the ability to define custom delimiters to prevent syntax conflicts within documents.

## Tags

### Development Tools & Productivity

- [Server-Side Dynamic Page Generation](https://awesome-repositories.com/f/development-tools-productivity/page-skeleton-generators/dynamic-page-generators/server-side-dynamic-page-generation.md) — Functions as a server-side engine that merges JavaScript data with templates to instantiate dynamic web pages.
- [Template-Based Code Generators](https://awesome-repositories.com/f/development-tools-productivity/template-based-code-generators.md) — Converts template syntax into executable JavaScript functions to generate final rendered strings.
- [Template Compilation](https://awesome-repositories.com/f/development-tools-productivity/template-extensions/template-functions/template-compilation.md) — Converts template strings into executable JavaScript functions to enable high-performance interpolation and cached execution.
- [Compiled Caches](https://awesome-repositories.com/f/development-tools-productivity/template-extensions/template-functions/template-compilation/compiled-caches.md) — Stores templates compiled into executable code in memory to avoid redundant parsing. ([source](https://github.com/tj/ejs#readme))

### Web Development

- [HTML Content Renderers](https://awesome-repositories.com/f/web-development/html-content-renderers.md) — Generates HTML output by combining dynamic data with reusable layouts and modular components. ([source](https://github.com/tj/ejs#readme))
- [Secure Renderers](https://awesome-repositories.com/f/web-development/html-content-renderers/secure-renderers.md) — Prevents cross-site scripting by automatically escaping special characters when rendering data into HTML.
- [JavaScript Template Engines](https://awesome-repositories.com/f/web-development/javascript-template-engines.md) — Provides a JavaScript template engine for Node.js that transforms template strings into executable functions for text generation.
- [Server-Side Rendering](https://awesome-repositories.com/f/web-development/server-side-rendering.md) — Transforms dynamic data and logic into static HTML strings on the server before sending them to the client.
- [Template Data Merging](https://awesome-repositories.com/f/web-development/template-data-merging.md) — Combines compiled templates from the filesystem with data objects to produce a final output string. ([source](https://github.com/tj/ejs/blob/master/History.md))

### Security & Cryptography

- [HTML Entity Escaping](https://awesome-repositories.com/f/security-cryptography/character-escaping/html-entity-escaping.md) — Automatically transforms dynamic data into safe HTML entities to prevent cross-site scripting attacks.
- [Output Escaping](https://awesome-repositories.com/f/security-cryptography/security/application-and-web/web-application/output-escaping.md) — Provides automatic encoding of dynamic data into safe formats to prevent cross-site scripting attacks during HTML rendering. ([source](https://github.com/tj/ejs#readme))
- [Automatic Template Escaping](https://awesome-repositories.com/f/security-cryptography/html-content-sanitization/xss-prevention-toggles/automatic-template-escaping.md) — Automatically encodes dynamic values in templates to prevent script injection during HTML processing.

### User Interface & Experience

- [Reusable Template Fragments](https://awesome-repositories.com/f/user-interface-experience/element-groupings/reusable-template-fragments.md) — Enables the use of shareable template fragments across multiple layouts to reduce redundancy. ([source](https://github.com/tj/ejs#readme))
- [Escaping Utilities](https://awesome-repositories.com/f/user-interface-experience/html-content-processing/html-content-processing/escaping-utilities.md) — Automatically encodes dynamic text content to prevent malicious script injection and XSS. ([source](https://github.com/tj/ejs/blob/master/Readme.md))
- [HTML Template Renderers](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/html-template-renderers.md) — Merges data dictionaries with predefined templates to generate final HTML strings for browser rendering. ([source](https://github.com/tj/ejs/blob/master/.gitmodules))
- [Reusable Components](https://awesome-repositories.com/f/user-interface-experience/page-layout-templates/reusable-components.md) — Supports the use of partial templates to create modular, reusable interface components within larger layouts.
- [Partial Templates](https://awesome-repositories.com/f/user-interface-experience/template-injection-hooks/partial-templates.md) — Supports reusable template fragments that can be nested and resolved by name at runtime. ([source](https://github.com/tj/ejs/blob/master/Readme.md))
- [Data Transformation Filters](https://awesome-repositories.com/f/user-interface-experience/layout-utilities/presentation-engines/template-engines/server-side-rendering-engines/html-template-renderers/template-component-renderers/template-filters/data-transformation-filters.md) — Provides functions within templates to transform raw data into specific formats before output. ([source](https://github.com/tj/ejs/blob/master/Readme.md))

### Data & Databases

- [Data Transformation Filters](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-transformation/output-template-engines/data-transformation-filters.md) — Allows transforming data using formatting modifiers before rendering the final content. ([source](https://github.com/tj/ejs/blob/master/History.md))
- [Template Caches](https://awesome-repositories.com/f/data-databases/in-memory-caches/node-js-caches/template-caches.md) — Implements in-memory caching of precompiled template functions to increase rendering speed and reduce CPU overhead.
- [Template Compilation Caches](https://awesome-repositories.com/f/data-databases/in-memory-caches/template-compilation-caches.md) — Stores precompiled JavaScript functions in memory to increase rendering speed for repeated requests.

### Programming Languages & Runtimes

- [Precompiled Template Execution](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/javascript-runtimes/javascript-build-engines/precompiled-template-execution.md) — Converts templates into standalone JavaScript functions for faster execution by removing the need for repeated parsing. ([source](https://github.com/tj/ejs/blob/master/History.md))

### Software Engineering & Architecture

- [Recursive Template Resolution](https://awesome-repositories.com/f/software-engineering-architecture/recursive-variable-expansion/recursive-template-resolution.md) — Resolves nested template fragments by recursively executing associated functions until a final string is produced.
- [Template Expression Parsing](https://awesome-repositories.com/f/software-engineering-architecture/regular-expression-based-parsing/template-expression-parsing.md) — Uses regular expressions to identify embedded logic and static text within template strings.

### Part of an Awesome List

- [Node.js Frameworks and Tools](https://awesome-repositories.com/f/awesome-lists/devtools/node-js-frameworks-and-tools.md) — Embedded JavaScript template engine.
