broken-record
A Handlebars powered CLI tool for defining file and directory structure templates.
Last updated 4 months ago by tomeraberbach .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install broken-record 
SYNC missed versions from official npm registry.

Broken Record

NPM version Build Status JavaScript Style Guide

A Handlebars powered CLI tool for defining file and directory structure templates.

Repeatably setting up new projects the same way can be annoying.

Broken Record allows you to define templates which can then be invoked and filled out in hassle-free way.

Install

Install with npm:

$ npm i broken-record -g

Usage

Show help information:

$ broken-record -h

Usage: broken-record [options] [command]

  Options:

    -V, --version         output the version number
    -h, --help            output usage information

  Commands:

    config [dir]          Displays or sets the templates directory
    register <dir>        Registers a template at a specified directory
    list                  Lists the available templates
    remove <name>         Removes a registered template
    get [options] <name>  Retrieves a registered template
    show [name]           Opens the templates directory or a template in the file explorer

  Template Specification:

    Directory Structure:
      <template-name>
          ├── template <-- template files directory
          └── template.json

    template.json:
      {
        "options": [
          {
            "name": "<variable-name>", <-- required
            "message": "<displayed-message>", <-- value of "name" used by default,
            "value": "<default-value-or-choices-array>" <-- default value can be boolean
          },
          ...
        ],
        "embed": {
          "<template-name>": {
            "directory": "<path-relative-to-template-dir>", <-- required
            "options": {
              "<option1>": "<handlebars-template>",
              ...
            }
          },
          ...
        }
      }

Set the templates directory location:

$ broken-record config
Looks like this is your first time running this command!
? Where should the 'templates' directory be created? path/to/some/dir
path/to/some/dir

Try out an example:

$ git clone https://github.com/TomerAberbach/broken-record-templates.git
$ cd broken-record-templates
$ broken-record register mit
The provided template was successfully registered.
$ broken-record register js-npm-module
The provided template was successfully registered.
$ broken-record get js-npm-module

Related projects

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running Tests

Install dev dependencies:

$ npm i -d && npm test

Author

Tomer Aberbach

License

Copyright © 2018 Tomer Aberbach Released under the MIT license.

Current Tags

  • 1.0.8                                ...           latest (4 months ago)

9 Versions

  • 1.0.8                                ...           4 months ago
  • 1.0.7                                ...           4 months ago
  • 1.0.6                                ...           4 months ago
  • 1.0.5                                ...           4 months ago
  • 1.0.4                                ...           4 months ago
  • 1.0.3                                ...           4 months ago
  • 1.0.2                                ...           4 months ago
  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 9
Last Month 2
Dependencies (10)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |