
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
grunt-ejs-mate
Advanced tools
A Grunt task for compiling ejs templates, using ejs-mate.
A fork of grunt-ejs.
Install this grunt plugin next to your project's
Gruntfile.js with: npm install grunt-ejs-mate --save-dev
.
Then add this line to your project's Gruntfile.js
:
grunt.loadNpmTasks('grunt-ejs-mate');
Add the task to your config and specify the destination for the compiled file:
grunt.initConfig({
'ejs-mate': {
all: {
src: ['app/**/*.ejs', '!app/partials/**/*'],
dest: 'dist/',
expand: true,
ext: '.html',
},
},
});
Use options
to pass data and helpers to the templates:
Gruntfile.js:
grunt.initConfig({
'ejs-mate': {
all: {
options: {
title: 'My Website',
url: function(url) {
return 'http://example.com/formatted/url/' + url;
},
},
src: ['app/**/*.ejs', '!app/partials/**/*'],
dest: 'dist/',
expand: true,
ext: '.html',
},
},
});
app/index.ejs:
<html>
<head>
<title><%= title %></title>
</head>
<body>
<a href="<%= url('home.html') %>">Home Page</a>
</body>
</html>
Ideally all your helpers and non-app specific config should be another module and merged in like this:
grunt.initConfig({
'ejs-mate': {
all: {
options: grunt.util._.merge(require('my-helpers'), {
title: 'My Website'
}),
src: 'index.ejs',
dest: 'index.html',
},
},
});
Copyright (c) 2015 Matt Blair Licensed under the MIT license.
FAQs
A grunt task for rendering ejs templates using ejs-mate.
The npm package grunt-ejs-mate receives a total of 7 weekly downloads. As such, grunt-ejs-mate popularity was classified as not popular.
We found that grunt-ejs-mate 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.