
Security News
NIST Officially Stops Enriching Most CVEs as Vulnerability Volume Skyrockets
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.
express-ejs-extend
Advanced tools
Layouts support for EJS templates in Express 3+.
First, add it as engine in your app:
// server.js
var express = require('express'),
path = require('path');
var app = express();
app.engine('ejs', require('express-ejs-extend')); // add this line
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, 'views'));
app.get('/', function (req, res) {
res.render('index', {title: 'world!'});
});
app.listen(3000);
Finally, in your views, call the extend function:
<%# views/index.ejs %>
<% extend('layout') %>
<h1>Hello <%= title %></h1>
<%# views/layout.ejs %>
<!DOCTYPE html>
<html>
<body>
<%- content %>
</body>
</html>
That's all, your GET / will render:
<!DOCTYPE html>
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>
extend), you can surround the extend with
any combination of (<% or <%-) and (%> or -%>).<%- content %> so the
engine doesn't escape your HTML tags. Also you can end it with -%> instead
to avoid any trailing \n.extend is: extend(layout[, data]), so you can also pass
an object with data and that will be passed to the layout.This project is released under the MIT license.
FAQs
Layouts support for EJS templates in Express 3+.
The npm package express-ejs-extend receives a total of 119 weekly downloads. As such, express-ejs-extend popularity was classified as not popular.
We found that express-ejs-extend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.