{"_id":"@koa/ejs","_rev":"3-cd29dbba7d060e516e7c5bd03fc1eae4","name":"@koa/ejs","dist-tags":{"latest":"5.1.0"},"versions":{"5.0.0":{"name":"@koa/ejs","version":"5.0.0","description":"ejs render middleware for Koa.js","main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/ejs.git"},"scripts":{"lint":"eslint .","pretest":"npm run lint","test":"cross-env NODE_ENV=test mocha --exit --reporter spec --timeout 5000 --require should test/*.test.js","precoverage":"rimraf .nyc_output coverage","coverage":"nyc npm run test","ci":"npm run coverage"},"keywords":["koa","middleware","render","ejs","view","template-engine"],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"contributors":[{"name":"Imed Jaberi","email":"imed-jaberi@outlook.com","url":"https://www.3imed-jaberi.com"}],"license":"MIT","dependencies":{"debug":"^4.3.4","ejs":"^3.1.8"},"devDependencies":{"cross-env":"^7.0.3","eslint":"^7.30.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.23.4","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-standard":"^5.0.0","koa":"^2.13.4","mocha":"^10.0.0","mz":"^2.7.0","nyc":"^15.1.0","should":"^13.2.3","supertest":"^6.2.4"},"engine":{"node":">= 12"},"bugs":{"url":"https://github.com/koajs/ejs/issues"},"homepage":"https://github.com/koajs/ejs","gitHead":"c59998ce006811c7cd960d93786fcfa3fd6ebd11","_id":"@koa/ejs@5.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-luxtlG1SEfAvbuMbsJYwxXXrXtESslbJsukeKnUiaBmtpkdmNV3M7iL6Ygm8oX67rnPd7tNCJpd7rmFSSBsHig==","shasum":"23a2a31ec705d83e60e8754c564aae066aae724f","tarball":"https://registry.npmjs.org/@koa/ejs/-/ejs-5.0.0.tgz","fileCount":4,"unpackedSize":8105,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQZS1QhuUGRHcSYJKLqXzRikOV0rvd0vpySCmeo0ZZkAiAJWuHPFk7OofJrcVqO7WKx9UG6/Ed0cG30CKMgZ/HF/g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPK9XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWAhAAjGeyKiRh4tQAszXl76dEVihkuE189xic+gDh37ZDgatP/upJ\r\noVEVRKmEngNF5hgO7iNC7n9o+Ft+kTYPfGrVKXypA3yI3MkV0bYaZ72dSPdk\r\n377ynA54p0P4D7tN9uNJA3Lyjc3pUUr51Y/gZcZI6q2e2jvFqYM8j7sZeuGE\r\nMRX0rfNNyCeIv6iot4xTfuPIde/jokFrdt6hiOG2rpwASmSqJYg+MGylT1Cf\r\nTCcfBAqOtDTjeTPyta+kZbCyrnbjY0GTCNt8ViENigTIoprrdeK7cAQi2WPK\r\npkIeK77Feu1A/qb+9gY8lhkeU6H+HAjLhZAkSDt86fxTjntbFONdy4kuKCme\r\nFitfc8CbJAUDI/SlOG9cbzRWVRnMIrm+/CZPF5Wi5JqqZ7X3RLjjxHQEnZdo\r\nmj/iZZgWsz/8C8YSeJ9T/jcVz2oFoQxl7/mDGIoL/OhXFe5U0fyju0Un87Cp\r\nwYj/Tnvm2A3fdqOLLiDe5e/VE9jdn5g+d3nbCDHEtGCkVQreS4x2tJIBnuJk\r\nSLloPFdG8NFtEVg7KKvI6/e2TFwlyW5Lb7DzdLzR10UDp2UIJB4712Kk5vf7\r\nXjCf4XbOczpV91zGt5CWiOYgcab53DZ0NlNKUujyM0Tw64RbXLi5iIG/+Aj6\r\nPME7l/fPSwaTmi3686G0mIO6H4ZlGjdSeik=\r\n=8imr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"titanism","email":"npm@titanism.com"},"directories":{},"maintainers":[{"name":"3imed-jaberi","email":"imed_jebari@hotmail.fr"},{"name":"titanism","email":"npm@titanism.com"},{"name":"niftylettuce","email":"niftylettuce@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"coderhaoxin","email":"haoxinst@gmail.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ejs_5.0.0_1664921431465_0.8438192875250721"},"_hasShrinkwrap":false},"5.1.0":{"name":"@koa/ejs","version":"5.1.0","description":"ejs render middleware for Koa.js","main":"index.js","repository":{"type":"git","url":"git+https://github.com/koajs/ejs.git"},"scripts":{"lint":"eslint .","pretest":"npm run lint","test":"cross-env NODE_ENV=test mocha --exit --reporter spec --timeout 5000 --require should test/*.test.js","precoverage":"rimraf .nyc_output coverage","coverage":"nyc npm run test","ci":"npm run coverage"},"keywords":["koa","middleware","render","ejs","view","template-engine"],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"contributors":[{"name":"Imed Jaberi","email":"imed-jaberi@outlook.com","url":"https://www.3imed-jaberi.com"}],"license":"MIT","dependencies":{"debug":"^4.3.4","ejs":"^3.1.8"},"devDependencies":{"cross-env":"^7.0.3","eslint":"^7.30.0","eslint-config-standard":"^16.0.3","eslint-plugin-import":"^2.23.4","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^5.1.0","eslint-plugin-standard":"^5.0.0","koa":"^2.13.4","mocha":"^10.0.0","mz":"^2.7.0","nyc":"^15.1.0","should":"^13.2.3","supertest":"^6.2.4"},"engine":{"node":">= 12"},"bugs":{"url":"https://github.com/koajs/ejs/issues"},"homepage":"https://github.com/koajs/ejs","gitHead":"866f65eb7cc175265c73d7afaf7a579871ef998a","_id":"@koa/ejs@5.1.0","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-cBP2uH+RUEuSb7zcRw6kKXucqjYNwQU1I9h59qGlvU+w08H1FYoj1lDor86f3PaekrpzyLyxZQAbtn0GMowe6w==","shasum":"ebe96de93541b7ec106e5235354cbefa70bcd50a","tarball":"https://registry.npmjs.org/@koa/ejs/-/ejs-5.1.0.tgz","fileCount":4,"unpackedSize":8110,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDg54D121veV8oDAeXYsWRe28TsvmM+yA1WYjQr1RICdAIhAJrRFfWDrgjhzLVC0eIxVfwX+u9xTNAqgVusIVW05Tq8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAM/lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBow/9E1KLLfn9yA3pzspozY6W9z0OabI83W3PBYRQLJe0BRlX/FXW\r\n0h3IeorcRjbQb2XUPDs7iYPm0mavOSWwhhiW4M4OhNrsbblKGIhnHf2WPUxR\r\nFWr8ZN1BsOVFh64L6CvS/9WHRxjIn+H28qsAWPl3sfs03Q/5wpreJ8v5uVeh\r\nT+W/52pxtU0c7hpsw8+Qi0pp2gofBN9FW5uA+PpDjxRBjHfnzA5m8v4en06U\r\ny3t9lTMnO45NorS+B98KGGmUiSHJT4AUnhjHrPDu6pqYmcrYGUYHfFCBl5l8\r\nYlXx7xgJ0c7zRhLrQTm35jSjSDFCRc3iRnlgEbgVJaHf8qrTqbdyNKlgNexg\r\nK5X/kWogOY1nhKJOuEdP9b1jDBjoOC8Qhx/fKnji1netq8qcBduQGUtYuk/M\r\n6ztO4OFHWtdeadLuI5dEp4OA58/v+cK9JEz4WCyMeq2sfiG9Dd9GYrDiDPvQ\r\n7H4fRTI2j2TCHST4AxkcUwmAUTxMmlIlMMavY6JYcDBrNp+aTik5CRJllrTU\r\nFnPRN+Hr+I6mz8uZV6tREe53hPu6zbmF9wznwLmv6SczCU0sKr0YVByGvxBn\r\n/eicZbQ/M+Ll8HMh2yTle0cMH3x+EqSwR26TtexD3bBiB2NLnId4diUyp79y\r\nRia0fOeNk17kMfzZ3w/mO4bAq7x0ha5Wz9Q=\r\n=EEzQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"titanism","email":"npm@titanism.com"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"3imed-jaberi","email":"imed_jebari@hotmail.fr"},{"name":"titanism","email":"npm@titanism.com"},{"name":"niftylettuce","email":"niftylettuce@gmail.com"},{"name":"fengmk2","email":"fengmk2@gmail.com"},{"name":"coderhaoxin","email":"haoxinst@gmail.com"},{"name":"dead_horse","email":"dead_horse@qq.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"},{"name":"juliangruber","email":"julian@juliangruber.com"},{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ejs_5.1.0_1677774821448_0.7680834516943884"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-04T22:10:31.383Z","5.0.0":"2022-10-04T22:10:31.651Z","modified":"2023-04-11T12:06:59.369Z","5.1.0":"2023-03-02T16:33:41.612Z"},"maintainers":[{"email":"ljharb@gmail.com","name":"ljharb"},{"email":"imed_jebari@hotmail.fr","name":"3imed-jaberi"},{"email":"npm@titanism.com","name":"titanism"},{"email":"niftylettuce@gmail.com","name":"niftylettuce"},{"email":"fengmk2@gmail.com","name":"fengmk2"},{"email":"dead_horse@qq.com","name":"dead_horse"},{"email":"jonathanrichardong@gmail.com","name":"jongleberry"},{"email":"julian@juliangruber.com","name":"juliangruber"},{"email":"aaron.heckmann+github@gmail.com","name":"aaron"}],"description":"ejs render middleware for Koa.js","homepage":"https://github.com/koajs/ejs","keywords":["koa","middleware","render","ejs","view","template-engine"],"repository":{"type":"git","url":"git+https://github.com/koajs/ejs.git"},"contributors":[{"name":"Imed Jaberi","email":"imed-jaberi@outlook.com","url":"https://www.3imed-jaberi.com"}],"author":{"name":"dead_horse","email":"dead_horse@qq.com","url":"http://deadhorse.me"},"bugs":{"url":"https://github.com/koajs/ejs/issues"},"license":"MIT","readme":"# @koa/ejs\n\n> Koa ejs view render middleware. support all feature of [ejs](https://github.com/mde/ejs).\n\n[![Build Status](https://secure.travis-ci.org/koajs/ejs.svg)](http://travis-ci.org/koajs/ejs)\n\n[![NPM](https://nodei.co/npm/@koa/ejs.png?downloads=true)](https://nodei.co/npm/@koa/ejs/)\n\n## Usage\n\n### Example\n\n```js\nconst Koa = require(\"koa\");\nconst render = require(\"@koa/ejs\");\nconst path = require(\"path\");\n\nconst app = new Koa();\nrender(app, {\n  root: path.join(__dirname, \"view\"),\n  layout: \"template\",\n  viewExt: \"html\",\n  cache: false,\n  debug: true,\n});\n\napp.use(async function (ctx) {\n  await ctx.render(\"user\");\n});\n\napp.listen(7001);\n```\n\nOr you can checkout the [example](https://github.com/koajs/ejs/tree/master/example).\n\n### Settings\n\n- root: view root directory.\n- fs: file system module with same Node.js fs interface (default `Node.js fs module`).\n- layout: global layout file, default is `layout`, set `false` to disable layout.\n- viewExt: view file extension (default `html`).\n- cache: cache compiled templates (default `true`).\n- debug: debug flag (default `false`).\n- delimiter: character to use with angle brackets for open / close (default `%`).\n- async: When true, EJS will use an async function for rendering. Depends on async/await support in the JS runtime.\n- outputFunctionName: Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags.\n\n### Layouts\n\n`@koa/ejs` supports layouts. The default layout file is `layout`. If you want to change default layout file, use `settings.layout`. Also you can specify layout by `options.layout` in `await ctx.render`.\nAlso you can set `layout = false` to disable the layout.\n\n```\n<html>\n  <head>\n    <title>koa ejs</title>\n  </head>\n  <body>\n    <h3>koa ejs</h3>\n    <%- body %>\n  </body>\n</html>\n```\n\n### Include\n\nSupports ejs includes.\n\n```\n<div>\n  <%- include ('user.html') -%>\n</div>\n```\n\n### State\n\nSupport [`ctx.state` in koa](https://github.com/koajs/koa/blob/master/docs/api/context.md#ctxstate).\n\n\n### TypeScript\n\nIf you're project based on TypeScript, we recommend using [`@types/koa-ejs`](https://www.npmjs.com/package/@types/koa-ejs) until we start supporting it in the upcoming releases.\n\n## Licences\n\n[(The MIT License)](LICENSE)\n","readmeFilename":"README.md"}