EJS extension for asynchronous template load
- Load EJS template files asynchronously in browser.
include
support in browser, and it loads included templates recursively.
Example
Example code is located in /example
directory.
How to use
First, load EJS and this extension in your HTML page.
API
ejs.renderAsync(path, data, callback)
- path: relative to the page, or absolute path of the ejs template file
- data: parameters that you want to pass to the templates
- callback: callback function that gives you rendered string. callback has two arguments,
error
andrendered
.- error: Error object if error occurs, otherwise null.
- rendered: Rendered string result.
Example code of ejs.renderAsync
ejs;
License
MIT