@alextanhongpin/gen-cli

A code generation utility

Usage no npm install needed!

<script type="module">
  import alextanhongpinGenCli from 'https://cdn.skypack.dev/@alextanhongpin/gen-cli';
</script>

README

Gen-CLI

Code generation with js.

Configuration

Example config.json that contains two commands, controller and service. Calling $ gen g controller foo will then create the template files first if it doesn't exist, and then the destination files. See config.sample.json5.

Usage

# Initialize config file.
$ gen init

# Run the template generation.
$ gen g <type> <name>

Templating

Uses handlebar.js because it allows us to register helpers.

TODO

  • read config from package.json, "gen"
  • force overwrite if exists warn if exists
  • better UI
  • allow configuration of templates (passing helpers)
  • compile to supported js versions
  • a golang version