
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Documentation - Chat - Playground
You're viewing the source for Eta v4
Eta is a lightweight and blazing fast embedded JS templating engine that works inside Node, Deno, and the browser. It's written in TypeScript and emphasizes great performance, configurability, and small bundle size.
🎯 Built with ts-base — A TypeScript library starter template featuring Biome, Vitest, tsdown, and automated releases. Check out ts-base for a modern TypeScript project setup!
<%= someval + "string %>" %> compiles correctly, while it fails with doT or EJSFor more thorough documentation, visit https://eta.js.org
Install Eta
npm install eta
In the root of your project, create templates/simple.eta
Hi <%= it.name %>!
Then, in your JS file:
import { Eta } from "eta";
// or use https://jsr.io/@bgub/eta
const eta = new Eta({ views: path.join(__dirname, "templates") });
// Render a template
const res = eta.render("./simple", { name: "Ben" });
console.log(res); // Hi Ben!
"Eta" means tiny in Esperanto. Plus, it can be used as an acronym for all sorts of cool phrases: "ECMAScript Template Awesomeness", "Embedded Templating Alternative", etc....
Additionally, Eta is a letter of the Greek alphabet (it stands for all sorts of cool things in various mathematical fields, including efficiency) and is three letters long (perfect for a file extension).
@shadowtime2000 created eta-vscode.
eslint-plugin-eta was created to provide an ESLint processor so you can lint your Eta templates.
Currently there is no official Webpack integration but @clshortfuse shared the loader he uses:
{
loader: 'html-loader',
options: {
preprocessor(content, loaderContext) {
return eta.render(content, {}, { filename: loaderContext.resourcePath });
},
},
}
To render Eta templates in Koa web framework: @cedx/koa-eta
To use Eta templates in your Vite project: @rinoshiyo/vite-plugin-eta
etaMade with ❤️ by bgub and many wonderful contributors. Contributions of any kind are welcome!
EJS (Embedded JavaScript) is a simple templating language that lets you generate HTML markup with plain JavaScript. It is similar to Eta in terms of syntax and functionality, but Eta is generally faster and more lightweight.
Pug (formerly known as Jade) is a high-performance template engine heavily influenced by Haml. It is known for its clean and minimal syntax. Compared to Eta, Pug offers a more concise syntax but has a steeper learning curve.
Handlebars is a popular templating engine that provides a more logic-less approach to templates. It uses a Mustache-like syntax and is known for its simplicity and ease of use. Unlike Eta, Handlebars enforces a separation of logic and presentation.
FAQs
Lightweight, fast, and powerful embedded JS template engine
The npm package eta receives a total of 2,051,246 weekly downloads. As such, eta popularity was classified as popular.
We found that eta demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.