1.0.6 • Published 2 years ago
templater-cli v1.0.6
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\ - add a new templatecreate|c\ - create files from templateinit|i- initialize configuration filelist|l- show all templatesremove|r\ - remove a template
Options
--config|-c\ - specify the config file (default: templater.json)--output|-o\ - 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