#handlebars #templating #web

app hdlbr

Handlebars CLI (Templating by command-line)

2 releases

0.1.1 Jun 17, 2019
0.1.0 Jun 17, 2019

#577 in Template engine

MIT license

4KB

hdlbr - Handlebars CLI

Usage

hdlbr VARIABLES_FILE TEMPLATE_FILE

Where:

  • VARIABLES_FILE is a JSON map, listing all vars.
  • TEMPLATE_FILE is a Handlebars template.

Example

vars.json:

{
  "name": "Foo",
  "comments": [
    {
      "author": "Dracula"
    },
    {
      "author": "Alucard"
    }
  ]
}

template.hbs:

Hello {{name}}
{{~#each comments}}
  {{author}}
{{~/each~}}

Result of hdlbr vars.json template.hbs:

Hello Foo
  Dracula
  Alucard

Build

You may use Rust 2018 and Cargo to build:

cargo build --release

Dependencies

~5.5–7.5MB
~142K SLoC