ejs-plus
v0.0.4
Published
A utility for rendering EJS templates with enhancements.
Readme
ejs-plus
A utility for rendering EJS templates with enhancements.
Installation:
yarn add ejs-plus
# or
npm install ejs-plusUsage:
const { render } = require("ejs-plus");
const html = render("./foo.ejs", {
foo: "bar",
list: [ 1, 2, 3 ],
});<%
const util = require("./path/to/some/util.js");
%>
<%= foo %>
<% for (const i of list) { %>
<%= i %>
<% } %>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 and file rendering
- [ ] create express view engine (docs)
