
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
@digitalmaas/esbuild-plugin-ejs
Advanced tools
An esbuild plugin that adds support for Embedded JavaScript Templates (.ejs) imports
An esbuild plugin that adds support for Embedded JavaScript Templates (.ejs) imports.
npm install @digitalmaas/esbuild-plugin-ejs --save-dev
import esbuild from 'esbuild'
import ejsPlugin from '@digitalmaas/esbuild-plugin-ejs'
await esbuild.build({
/* all of your config */,
plugins: [
ejsPlugin({ /* ejs options */ }),
]
})
<!-- template.ejs -->
<html>
<head>
<title><%= locals.title =></title>
</head>
<body>
<% if (locals.isAdmin) { %>
<div>ADMIN</div>
<% } else { %>
<div>USER</div>
<% } %>
<h1><%= locals.name %></h1>
</body>
</html>
import template from './template.ejs'
const templateAsString = template({ isAdmin: false, title: 'Doc Title', name: 'Cool Test' })
delimiter: string
Character to use for inner delimiter. Defaults to '%'
.
openDelimiter: string
Character to use for opening delimiter. Defaults to '<'
.
closeDelimiter: string
Character to use for closing delimiter. Defaults to '>'
.
localsName: string
Name to use for the object storing local variables. Defaults to locals
.
rmWhitespace: boolean
Remove all safe-to-remove whitespace, including leading and trailing whitespace. It also enables a safer version of `-%>`` line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line).
async: boolean
When true, EJS will use an async function for rendering.
MIT License.
Complete license in ./LICENSE file.
FAQs
An esbuild plugin that adds support for Embedded JavaScript Templates (.ejs) imports
We found that @digitalmaas/esbuild-plugin-ejs 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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.