yhe

yeoman-handlebars-engine

Write yeoman generator templates in handlebars

Showing:

Popularity

Downloads/wk

4

GitHub Stars

3

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

3

Size (min+gzip)

19.1KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

yeoman-handlebars-engine

Deprecated

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.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100