Edge is a batteries included template engine for Node.js. It is written from ground up and attempts to solve every little issue you had with template engines in the past.

  • Fully featured with support for conditionals, loops and partials
  • The only Node.js template engine that has Components
  • Stack traces that points to the original filename and line number
  • Runtime debugging using Chrome DevTools
  • Extensible API for adding custom Edge tags

The Edge Syntax

We have put a lot of thoughts in finalizing the Edge syntax. The main goals were to keep API surface area small and writing Edge should feel like writing regular JavaScript.

Finally, we ended up with two distinct ways for writing dynamic code inside Edge template files.

Handles Newlines the right way

Most of the template engines poorly handles new lines. Since, many of us use template engines to output HTML, we never notice the extra newlines as HTML is not sensitive to the \n character.

Let's try to build a YAML file using Nunjucks and Edge both to witness the real issue.

Helpful Stack Trace

Again, most of the template engines fall short with error stack trace. Since, the templates are compiled to a Javascript function, it is not always easy to point back to original source code.

However, Edge will not disappoint you. Both compile-time and run-time errors always points back to the original source file.