There were major breaking changes in v1.0!.
const handlebars = require('handlebars');
const engine = require('{%= name %}')(handlebars);
console.log(engine);
The engine
object that is returned has the following properties:
name
- the name of the engine:handlebars
, used for engine detection in other libraries.instance
- your instance of handlebarscompile
- async compile methodcompileSync
- sync compile methodrender
- async render methodrenderSync
- sync render method
{%= apidocs("index.js") %}
- The main export is now a function that takes an instance of handlebars.
renderFile
and__express
have been removed..compile
and.render
now return a promise..compileSync
and.renderSync
may be used for sync operations.- All methods now expect a
file
object with a.contents
property (string or buffer).
renderFile
now expects a [vinyl][] file.- The old renderFile method is now exposed on
engine.__express
- updated to handlebars 0.4.0