{"name":"eta","version":"4.2.0","keywords":["handlebars","ejs","eta","template engine","embedded template engine","layouts","partials","typescript types"],"author":{"name":"Ben Gubler","email":"nebrelbug@gmail.com"},"license":"MIT","_id":"eta@4.2.0","maintainers":[{"name":"nebrelbug","email":"nebrelbug@gmail.com"},{"name":"bgub","email":"me@bengubler.com"}],"homepage":"https://eta.js.org","bugs":{"url":"https://github.com/bgub/eta/issues"},"dist":{"shasum":"32ae1f6afd0193822eaa166a824a5a588236fe24","tarball":"http://registry-npm.ywwl.com/eta/download/eta-4.2.0.tgz","fileCount":9,"integrity":"sha512-qPM36JtfuXIB+ZbgrlrUKGkbn0I8sRwOd1CCmGk71Wu+thSM3/0Oa9ulqwKiJ3TWrsnlsrKVKOSa/yLIDtCnPg==","signatures":[{"sig":"MEQCIDTVQxjTS2crlDQg7jkhlHcD3qUw1vHWdyIDLc5fVEzBAiBjUBbDD1OQDnoIhth4JdhG5trcz72jW08Md9MNbG+2Fg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/eta@4.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":120686,"size":31834,"noattachment":false,"key":"/eta/-/eta-4.2.0.tgz"},"type":"module","types":"./dist/index.d.ts","browser":"./dist/core.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./core":{"types":"./dist/core.d.ts","import":"./dist/core.js"}},"funding":"https://github.com/bgub/eta?sponsor=1","gitHead":"332dd4f78d54a6b8dfab1d7ef7dd20bf7801b999","scripts":{"dev":"tsdown --watch","lint":"biome check --error-on-warnings","size":"size-limit","test":"vitest run --coverage","build":"tsdown","format":"biome format --write","prepare":"npm run build"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b9ccf048-e0ed-4a1d-9243-6e3d3fe2a5f1"}},"repository":{"url":"git+https://github.com/bgub/eta.git","type":"git"},"size-limit":[{"path":"dist/core.js","limit":"3.5 KB"}],"_npmVersion":"11.6.2","description":"Lightweight, fast, and powerful embedded JS template engine","directories":{},"sideEffects":false,"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.15.0","vitest":"^3.2.4","size-limit":"^8.2.4","typescript":"^5.9.2","@types/node":"^22.18.1","@biomejs/biome":"2.2.3","@vitest/coverage-istanbul":"3.2.4","@size-limit/preset-small-lib":"^8.2.4"},"_npmOperationalInternal":{"tmp":"tmp/eta_4.2.0_1762986968870_0.6491351663285021","host":"s3://npm-registry-packages-npm-production"},"readme":"<p align=\"center\">\n  <img align=\"center\" width=\"50%\" src=\"https://github.com/bgub/eta/assets/25597854/041dbe34-883b-459b-8607-c787815c441a\">\n</p>\n\n<h1 align=\"center\" style=\"text-align: center; width: fit-content; margin-left: auto; margin-right: auto;\">eta (η)</h1>\n\n<p align=\"center\">\n  <a href=\"https://eta.js.org\">Documentation</a> -\n  <a href=\"https://discord.gg/27gGncJYE2\">Chat</a> -\n  <a href=\"https://eta.js.org/playground\">Playground</a>\n</p>\n\n<span align=\"center\">\n\n[![GitHub package.json version (main)](https://img.shields.io/github/package-json/v/bgub/eta/main?label=current%20version)](https://www.npmjs.com/package/eta)\n[![GitHub Actions Status](https://github.com/bgub/eta/actions/workflows/ci.yml/badge.svg)](https://github.com/bgub/eta/actions)\n[![Codecov](https://codecov.io/github/bgub/eta/branch/main/graph/badge.svg)](https://codecov.io/github/bgub/eta)\n[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/bengubler)\n\n</span>\n\n<span align=\"center\">\n\n**You're viewing the source for Eta v4**\n\n</span>\n\n## Summary\n\nEta 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.\n\n> 🎯 **Built with [ts-base](https://github.com/bgub/ts-base)** — A TypeScript library starter template featuring Biome, Vitest, tsdown, and automated releases. Check out ts-base for a modern TypeScript project setup!\n\n### 🌟 Features\n\n- 📦 0 dependencies\n- 💡 Only ~3.5 KB minzipped\n- ⚡️ Written in TypeScript\n- ✨ Deno support (+ Node and browser)\n- 🚀 Super Fast\n- 🔧 Configurable\n  - Plugins, custom delimiters, caching\n- 🔨 Powerful\n  - Precompilation, partials, async, blocks\n  - **Layout support**!\n- 🔥 Reliable\n  - Better quotes/comments support\n    - _ex._ `<%= someval + \"string %>\" %>` compiles correctly, while it fails with doT or EJS\n  - Great error reporting\n- ⚡️ Exports ES Modules\n- 📝 Easy template syntax\n\n## Get Started\n\n_For more thorough documentation, visit [https://eta.js.org](https://eta.js.org)_\n\nInstall Eta\n\n```bash\nnpm install eta\n```\n\nIn the root of your project, create `templates/simple.eta`\n\n```eta\nHi <%= it.name %>!\n```\n\nThen, in your JS file:\n\n```js\nimport { Eta } from \"eta\";\n// or use https://jsr.io/@bgub/eta\n\nconst eta = new Eta({ views: path.join(__dirname, \"templates\") });\n\n// Render a template\n\nconst res = eta.render(\"./simple\", { name: \"Ben\" });\nconsole.log(res); // Hi Ben!\n```\n\n## FAQs\n\n<details>\n  <summary>\n    <b>Where did Eta's name come from?</b>\n  </summary>\n\n\"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....\n\nAdditionally, 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).\n\n</details>\n\n<br />\n\n## Integrations\n\n<details>\n  <summary>\n    <b>Visual Studio Code</b>\n  </summary>\n\n[@shadowtime2000](https://github.com/shadowtime2000) created [eta-vscode](https://marketplace.visualstudio.com/items?itemName=shadowtime2000.eta-vscode).\n\n</details>\n\n<details>\n  <summary>\n    <b>ESLint</b>\n  </summary>\n\n[eslint-plugin-eta](https://github.com/eta-dev/eslint-plugin-eta) was created to provide an ESLint processor so you can lint your Eta templates.\n\n</details>\n\n<details>\n  <summary>\n    <b>Webpack</b>\n  </summary>\n\nCurrently there is no official Webpack integration but [@clshortfuse](https://github.com/clshortfuse) shared the loader he uses:\n\n```javascript\n{\n  loader: 'html-loader',\n  options: {\n    preprocessor(content, loaderContext) {\n      return eta.render(content, {}, { filename: loaderContext.resourcePath });\n    },\n  },\n}\n```\n\n</details>\n\n<details>\n  <summary>\n    <b>Node-RED</b>\n  </summary>\n\nTo operate with Eta templates in Node-RED: [@ralphwetzel/node-red-contrib-eta](https://flows.nodered.org/node/@ralphwetzel/node-red-contrib-eta)\n\n  <img width=\"150\" alt=\"image\" src=\"https://user-images.githubusercontent.com/16342003/160198427-2a69ff10-e8bf-4873-9d99-2929a584ccc8.png\">\n\n</details>\n\n<details>\n  <summary>\n    <b>Koa</b>\n  </summary>\n\nTo render Eta templates in [Koa](https://koajs.com) web framework: [@cedx/koa-eta](https://github.com/cedx/koa-eta/wiki)\n\n</details>\n\n<details>\n  <summary>\n    <b>Vite</b>\n  </summary>\n\nTo use Eta templates in your Vite project: [@rinoshiyo/vite-plugin-eta](https://github.com/rinoshiyo/vite-plugin-eta)\n\n</details>\n\n<br />\n\n## Projects using `eta`\n\n- [Docusaurus v2](https://v2.docusaurus.io): open-source documentation framework that uses Eta to generate a SSR build\n- [swagger-typescript-api](https://github.com/acacode/swagger-typescript-api): Open source typescript api codegenerator from Swagger. Uses Eta as codegenerator by templates\n- [html-bundler-webpack-plugin](https://github.com/webdiscus/html-bundler-webpack-plugin): Webpack plugin make easily to bundle HTML pages from templates, source styles and scripts\n- [SmartDeno](https://github.com/guildenstern70/SmartDeno): SmartDeno is an easy to setup web template using Deno & Oak\n- [stc](https://github.com/long-woo/stc): OpenAPI (Swagger) and Apifox documentation converted to api. Use eta templates to generate code.\n- [Add yours!](https://github.com/bgub/eta/edit/master/README.md)\n\n## Contributors\n\nMade with ❤️ by [bgub](https://github.com/bgub) and [many wonderful contributors](https://github.com/bgub/eta/graphs/contributors). Contributions of any kind are welcome!\n\n## Credits\n\n- Async support, file handling, and error formatting were based on code from [EJS](https://github.com/mde/ejs), which is licensed under the Apache-2.0 license. Code was modified and refactored to some extent.\n- Syntax and some parts of compilation are heavily based off EJS, Nunjucks, and doT.\n","publish_time":1762986969019,"_cnpm_publish_time":1762986969019,"dist-tags":{"latest":"4.6.0","next":"4.0.0-beta.1"}}