0.0.1 • Published 5 years ago

anyengine v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

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

NameTypeDescription
basedirstringSpecify basedir. Used to resolve partials and data. Defaults to current working dir.
datastringSpecify directory where to resolve json data.
filenamestringSpecify filename when rendering strings. Used to resolve partials and data.
runtimestring|function|object Specify engine runtime, i.e. 'handlebars'. If not specified, it is resolved by filename.
usearraySpecify middleware, i.e. [ 'frontmatter' ].