EJS version 5.0.1 is a major release that removes deprecated options, fixes template behavior with custom delimiters, improves the CLI and build pipeline, and simplifies the package by moving Jake to a dev-only dependency.
- Removed
clientoption (Fixes #746): The legacyclientflag and related code have been removed. This option produced browser-oriented template functions by inlining escape and rethrow helpers; it was unmaintained and broken. Use the standard browser bundle (ejs.min.js) or compile templates for the client using your own build setup.
- Custom delimiters and whitespace-slurp tags (Fixed #780): Whitespace-slurp
tags (
<%_and_%>by default) now respect customopenDelimiter,delimiter, andcloseDelimiter. Previously, the slurp regex was hardcoded to<%/%>, so custom delimiters did not work correctly with<%_/_%>-style tags.
- CLI no longer depends on Jake: The
ejsCLI now uses a bundled argument parser (lib/esm/parseargs.js/lib/cjs/parseargs.js) instead of the Jake program module. Jake remains a devDependency for the build (lint, compile, browserify, minify, test). - Jake moved to devDependencies: Jake was moved from
dependenciestodevDependencies, so installingejsas a dependency no longer pulls in Jake. - Minification fix: The minify task now minifies the browserified
ejs.jsbundle (output of the browserify task) instead oflib/cjs/ejs.js, so the browser bundle is correctly minified.
- JSDoc updates: Removed references to the
clientoption andClientFunctionfrom options and template-function documentation. - Examples:
examples/client-compilation.htmlandexamples/express/app.jsupdated to remove use of theclientoption; Express example no longer passesclient: true. - README: Removed broken link to the third-party EJS playground.
- Tests: Removed tests that targeted the removed
clientoption behavior. - Utils: Removed unused
client-related code fromlib/esm/utils.js.
- Option removed: The
clientoption is no longer supported. Passingclient: true(or any value) is ignored; no error is thrown, but no client-specific output is produced. - Migration: Rely on the standard API and the browser build (
ejs.min.js) for browser use, or compile templates in your own build pipeline if you need client-side rendering with custom setup.
- mde (Matthew Eernisse)
If you're upgrading from version 4.x:
-
If you used the
clientoption: Removeclient: true(or similar) from your options. Useejs.render()orejs.renderFile()as usual; for browsers, loadejs.min.jsor bundle the CJS/ESM build. If you depended on the old client output format, you will need to implement your own client compilation or use a different approach. -
If you use custom delimiters with whitespace-slurp tags: Upgrading fixes behavior so that tags like
<%_and_%>are correctly recognized whenopenDelimiter,delimiter, orcloseDelimiterare set. No code changes required. -
Install size: Installing
ejsas a dependency no longer installs Jake, which may slightly reduce install size and dependency tree depth.
npm install ejs@5.0.1Generated from git log: v4.0.1..v5.0.1