1.0.3 • Published 5 years ago

@paaragon/ctg-cli v1.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

ctg-cli

Custom Template Generator: NodeJs cli command to create files from templates.

Instalation

WIP

Usage

$ ctg-cli -t <template> <file-name>

Example

$ ctg-cli -t class foo

This will create the following file tree

/-
 |_ foo.js

And the content of foo.js will be

export default class Foo {

    constructor() { }
}

Specify destination file path

You can specify the path of the destination file like this:

$ ctg-cli -t class <path>/<to>/foo

This will create the following file tree

/-
 |_ path
    |_ to
       |_ foo.js

Template

Default templates are stored in templates folder. To use them, you have to specify the template name when invoking ctg-cli. Available templates are:

  • class
  • class-ts

Custom templates

WIP

Templates languaje

By default, ctg-cli assumes that files are JavaScript files. You can change this in your custom template by adding a first line with the extension of the file like this:

#!your-extension
// your template

For example

#!ts
export default class @(model.name.charAt(0).toUpperCase() + model.name.slice(1)) {

    constructor() { }
}
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago