Just Another Template Generator
npm install jatgjatg to generate the resulting files.
npx jatg --init, or just start by copying the example below:
json
{
"$schema": "https://unpkg.com/jatg/templates.schema.json",
"templates": [
{
"name": "my-awesome-template",
"sourcePaths": ["./templates"],
"outputPath": "./src/modules",
"variables": [
{
"variable": "name",
"name": "Module Name"
}
]
}
]
}
`
This should be enough for most use-cases, but you can read the configuration reference for a list of all possible properties.
$3
You can have as many files as needed for a single template.
templates/%name%.ts
`
export class %name.pascalCase% {
// ...
}
`
The template can have variables, and they can be transformed through functions. Read more about them in the variables reference.
$3
Just run the CLI to generate files based on the templates created.
You'll be prompted which template you want to generate, and what are the variable values.
`sh
npx jatg
``