
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.
Koa ejs view render middleware. support all feature of ejs.
const Koa = require("koa");
const render = require("@koa/ejs");
const path = require("path");
const app = new Koa();
render(app, {
root: path.join(__dirname, "view"),
layout: "template",
viewExt: "html",
cache: false,
debug: true,
});
app.use(async function (ctx) {
await ctx.render("user");
});
app.listen(7001);
Or you can checkout the example.
Node.js fs module).layout, set false to disable layout.html).true).false).%).@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.
Also you can set layout = false to disable the layout.
<html>
<head>
<title>koa ejs</title>
</head>
<body>
<h3>koa ejs</h3>
<%- body %>
</body>
</html>
Supports ejs includes.
<div>
<%- include ('user.html') -%>
</div>
Support ctx.state in koa.
If you're project based on TypeScript, we recommend using @types/koa-ejs until we start supporting it in the upcoming releases.
FAQs
ejs render middleware for Koa.js
The npm package @koa/ejs receives a total of 4,481 weekly downloads. As such, @koa/ejs popularity was classified as popular.
We found that @koa/ejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 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.