templater-cli
v1.0.6
Published
CLI for creating files by templates
Downloads
9
Maintainers
Readme
Templater CLI
Templater is a simple command line tool for managing and generating files from templates.
Installation
npm install templater-cli --save-devUsage
templater <command> [options]Commands
add|a<templateName> - add a new templatecreate|c<templateName> - create files from templateinit|i- initialize configuration filelist|l- show all templatesremove|r<templateName> - remove a template
Options
--config|-c<path> - specify the config file (default: templater.json)--output|-o<path> - specify the output directory (only for create command)
Config file
{
"templatesPath": "./templates",
"filesCase": "kebab",
"templates": [
{
"name": "ui",
"description": "ui components",
"templatePath": "./ui",
"outputPath": "./src/shared/ui",
"replaceRules": [
{
"keyword": "__name__",
"case": "pascal"
}
]
}
]
}templatesPath- path to templates directory (default: ./templates)filesCase- case of the generated filestemplates- templates rules array:name- template namedescription- template descriptiontemplatePath- path to template directoryoutputPath- path to output directoryreplaceRules- replace rules array:keyword- keyword to replacecase- case of the keyword
Available cases
camel- camelCasekebab- kebab-casepascal- PascalCasesnake- snake_caseupper- UPPER_CASElower- lowercase
