README
@chriscalo/ejs-extra
ejs-plus
DEPRECATED. SeeA utility for rendering EJS templates with a few enhancements.
Installation:
yarn add @chriscalo/ejs-extra
# or
npm install @chriscalo/ejs-extra
Usage:
const html = render("./foo.ejs", {
req,
res,
list: [ 1, 2, 3 ],
});
<%
const util = require("./path/to/some/util.js");
%>
<%= req.originalUrl %>
Features:
- use
require()
in EJS files - a better
include()
function with support for absolute, relative, and module paths - helpful errors messages via ejs-lint
TODO:
- async rendering
- separate functions for string a file rendering
- create express view engine (docs)