{"name":"eta","version":"2.1.2","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@2.1.2","maintainers":[{"name":"nebrelbug","email":"nebrelbug@gmail.com"},{"name":"shadowtime2000","email":"shadowtime2000@gmail.com"}],"homepage":"https://eta.js.org","bugs":{"url":"https://github.com/eta-dev/eta/issues"},"dist":{"shasum":"2ac3899234552b60da87e5e781494ee1a8048fbc","tarball":"http://registry-npm.ywwl.com/eta/download/eta-2.1.2.tgz","fileCount":41,"integrity":"sha512-qWH+mERhihcwKE9+Ah37rLDTP0d3Qc5KEsnEQhvoBowDezVI2F6+bqjRBVY+auUYOUb94MI0x5fllZs+CWVRRQ==","signatures":[{"sig":"MEUCIQDcxzcRXiDsbPo+WY+OFhhTakJ7Q3uoONqZ8PrqUfvzqwIgf4WUqmTW/QG5kU0XxszV0AtayUPL1Xy+Q0b65VcMNSY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":308846,"size":80115,"noattachment":false,"key":"/eta/-/eta-2.1.2.tgz"},"jest":{"testRegex":"\\/test\\/(?!deno\\/).*(\\.spec\\.ts)$","transform":{".(ts)":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"coverageThreshold":{"global":{"lines":95,"branches":85,"functions":95,"statements":95}},"collectCoverageFrom":["src/!(*.deno|browser).ts"],"moduleFileExtensions":["ts","js"],"testPathIgnorePatterns":["/src/*.deno.ts"],"coveragePathIgnorePatterns":["/node_modules/","/test/","/test/deno/","/src/*.deno.ts"]},"main":"./dist/eta.umd.js","type":"commonjs","husky":{"hooks":{"pre-commit":"lint-staged"}},"types":"./dist/types/index.d.ts","unpkg":"./dist/browser.min.umd.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"module":"./dist/eta.module.mjs","source":"src/index.ts","engines":{"node":">=6.0.0"},"exports":{"types":"./dist/types/index.d.ts","import":"./dist/eta.module.mjs","browser":"./dist/browser.min.umd.js","default":"./dist/eta.umd.js","require":"./dist/eta.umd.js"},"funding":"https://github.com/eta-dev/eta?sponsor=1","gitHead":"4be3cbe13863f78fd8149c6c74b94f2ce996dec6","scripts":{"lint":"eslint src/*.ts test/*.spec.ts examples/* --ext .js,.ts","size":"size-limit","test":"jest --coverage && npm run test:deno && npm run size","build":"denoify && npm run build:node && npm run build:browser && rimraf docs && typedoc --tsconfig tsconfig.json src && deno fmt deno_dist/*.ts","start":"microbundle watch","commit":"git-cz","format":"prettier --write '{src,test}/**/!(*.deno).ts' && deno fmt deno_dist/*.ts","release":"npm run build && np","prebuild":"rimraf dist && rimraf deno_dist","test:deno":"deno test test/deno/*.spec.ts --allow-read --unstable","test:prod":"npm run lint && npm run test -- --no-cache","build:node":"microbundle src/index.ts --target node --format esm,umd","test:watch":"jest --coverage --watch","deploy-docs":"ts-node tools/gh-pages-publish","build:browser":"microbundle src/browser.ts --target web --format umd --output dist/browser.min.js","report-coverage":"cat ./coverage/lcov.info | coveralls","travis-deploy-once":"travis-deploy-once --pro"},"_npmUser":{"name":"nebrelbug","email":"nebrelbug@gmail.com"},"standard":{"ignore":["dist","deno_dist","src/*.deno.ts"]},"umd:main":"./dist/eta.umd.js","commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/eta-dev/eta.git","type":"git"},"size-limit":[{"path":"dist/browser.min.umd.js","limit":"3 KB"}],"_npmVersion":"8.19.3","description":"Lightweight, fast, and powerful embedded JS template engine","directories":{},"lint-staged":{"{src,test}/**/!(*.deno).ts":["eslint"]},"sideEffects":false,"_nodeVersion":"19.2.0","_hasShrinkwrap":false,"devDependencies":{"np":"^7.6.3","jest":"^29.4.3","husky":"^4.3.8","tslib":"^2.5.0","eslint":"^8.35.0","rimraf":"^4.1.2","denoify":"^1.4.10","shelljs":"^0.8.5","ts-jest":"^29.0.5","ts-node":"^10.9.1","typedoc":"^0.23.26","prettier":"^2.8.4","coveralls":"^3.1.1","cross-env":"^7.0.3","commitizen":"^4.3.0","size-limit":"^8.2.4","typescript":"^4.9.5","@types/jest":"^29.4.0","@types/node":"^18.14.2","lint-staged":"^13.1.2","microbundle":"^0.15.1","@commitlint/cli":"^17.4.4","eslint-plugin-n":"^15.6.1","travis-deploy-once":"^5.0.11","eslint-plugin-import":"^2.27.5","eslint-plugin-promise":"^6.1.1","eslint-config-prettier":"^8.6.0","@typescript-eslint/parser":"^5.53.0","cz-conventional-changelog":"^3.3.0","@size-limit/preset-small-lib":"^8.2.4","@commitlint/config-conventional":"^17.4.4","@typescript-eslint/eslint-plugin":"^5.53.0"},"_npmOperationalInternal":{"tmp":"tmp/eta_2.1.2_1683942997772_0.7631754541928804","host":"s3://npm-registry-packages"},"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":1683942997994,"_cnpm_publish_time":1683942997994,"dist-tags":{"latest":"4.6.0","next":"4.0.0-beta.1"}}