0.0.1 • Published 7 years ago
anyengine
Licence
ISC
Version
0.0.1
Deps
9
Size
19 kB
Vulns
0
Weekly
0
anyengine
A meta-programming approach to universal templating
API
Engine.configure([options])
Specify default options
Engine.compile(template, [options])
Compiles template string
Engine.compileFile(filename, [options], [callback])
Compiles template file
Engine.render(template, [locals], [options])
Renders template string
Engine.renderFile(filename, [locals], [options], [callback])
Renders template file
Options
| Name | Type | Description |
|---|---|---|
| basedir | string |
Specify basedir. Used to resolve partials and data. Defaults to current working dir. |
| data | string |
Specify directory where to resolve json data. |
| filename | string |
Specify filename when rendering strings. Used to resolve partials and data. |
| runtime | string|function|object |
Specify engine runtime, i.e. 'handlebars'. If not specified, it is resolved by filename. |
| use | array |
Specify middleware, i.e. [ 'frontmatter' ]. |