| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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. Created by bgub (Ben Gubler).
🎯 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!
For more thorough documentation, visit https://eta.js.org
Install Eta
npm install etaIn 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.
ESLinteslint-plugin-eta was created to provide an ESLint processor so you can lint your Eta templates.
WebpackCurrently 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 operate with Eta templates in Node-RED: @ralphwetzel/node-red-contrib-eta
Koa
To render Eta templates in Koa web framework: @cedx/koa-eta
ViteTo use Eta templates in your Vite project: @rinoshiyo/vite-plugin-eta
Made with ❤️ by bgub (Ben Gubler) and many wonderful contributors. Contributions of any kind are welcome!
| Back | FazBrowse Home | New Git URL |