0.1.0 • Published 8 years ago

justo-plugin-handlebars v0.1.0

Weekly downloads
4
License
-
Repository
github
Last release
8 years ago

Build Status

Plugin for Handlebars template system.

Proudly made with ♥ in Valencia, Spain, EU.

Install

npm install justo-plugin-handlebars

render task

To render a file:

render(opts, config)

The config properties:

  • src (string). The template file.
  • dst (string). The destination file.
  • scope (object). The data.
  • helpers (object). Custom helpers to use.
  • partials (object). Custom partials to use.

Example:

const hbs = require("justo-plugin-handlebars");

hbs.render("Generate conf/mongod.conf", {
  src: "templates/conf/mongod.conf",
  dst: "/opt/mongodb/conf/mongod.conf",
  scope: {
    dataFolder: "/opt/mongodb/data/",
    logFolder: "/opt/mongodb/log/",
    journal: true
  }
});