
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
egg-view-ejs
Advanced tools
egg view plugin for ejs.
$ npm i egg-view-ejs --save
// {app_root}/config/plugin.js
exports.ejs = {
enable: true,
package: 'egg-view-ejs',
};
// {app_root}/config/config.default.js
exports.view = {
mapping: {
'.ejs': 'ejs',
},
};
// ejs config
exports.ejs = {};
Create a ejs file
// app/view/hello.ejs
hello <%= data %>
Render it
// app/controller/render.js
exports.ejs = function* () {
yield ctx.render('hello.ejs', {
data: 'world',
});
};
The file will be compiled and cached, you can change config.ejs.cache = false to disable cache, it's disable in local env by default.
You can include both relative and absolute file.
Relative file is resolve from current file path.
// app/view/a.ejs include app/view/b.ejs
<% include b.ejs %>
Absolute file is resolve from app/view.
// app/view/home.ejs include app/view/partial/menu.ejs
<% include /partial/menu.ejs %>
You can render a view with layout also:
// app/view/layout.ejs
<%- body%>
// app/controller/render.js
exports.ejs = function* () {
const locals = {
data: 'world',
};
const viewOptions = {
layout: 'layout.ejs'
};
yield ctx.render('hello.ejs', locals, viewOptions);
};
see config/config.default.js for more detail.
Please open an issue here.
FAQs
egg view plugin for ejs
The npm package egg-view-ejs receives a total of 502 weekly downloads. As such, egg-view-ejs popularity was classified as not popular.
We found that egg-view-ejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.