yeoman-handlebars-engine

    1.0.1 • Public • Published

    yeoman-handlebars-engine

    Write Yeoman generator templates in Handlebars with Underscore.string helpers.

    NPM version Build Status

    Getting Started

    > npm install yeoman-handlebars-engine

    Use it in your generator:

    handlebarsEngine = require 'yeoman-handlebars-engine'
     
    class RobotGenerator extends yeoman.generators.Base
      engine: handlebarsEngine()
      constructor: (args, options, config) ->
        super

    Configuration

    Settings Handlebar delimiters (default to '{{' and '}}'):

    handlebarsEngine = require 'yeoman-handlebars-engine'
    engine = handlebarsEngine('<%=''%>')

    Helpers

    Using Underscore.string helpers in your generator templates:

    @myClass = 'robot generator'
    @bigNumber = 123456789.123
    My class: {{ classify myClass}}
    Big number: {{ numberFormat bigNumber 5 "." ","}}

    Outputs:

    My class: RobotGenerator
    Big number: 123,456,789.12300

    Changelog

    v1.0

    Breaking change: Export a function that configures Handlebars and returns an engine, instead of exporting the engine directly.

    Install

    npm i yeoman-handlebars-engine

    DownloadsWeekly Downloads

    0

    Version

    1.0.1

    License

    none

    Last publish

    Collaborators

    • hurrymaplelad