🎞 render-in-place
Render an ejs templated file, overwriting it with the result.
Usage
Import
This module exposes a function as its default
export.
CommonJS
const render = default;
TypeScript
With allowSyntheticDefaultImports
; render...
Without allowSyntheticDefaultImports
; render... // or ; rip.render...
Example
; render '/path/to/template', // path to template file , // data passed to template ,
Documentation
render(path: string, data: object, config: object)
path
The absolute path to your template file.
data
Any data to pass off to the template when rendering. This
value is provided directly to ejs
when rendering your file.
config
Extra configuration provided to ejs.renderFile
or
fs.writeFile
.
config.read
Configuration passed to ejs.renderFile
.
config.write
Configuration passed to fs.writeFile
.