template-generator
Help generate template files (angular, nodejs, backbone, java...)
Prerequisites
This project has a dependencies that require Node to be installed. For help to install Node, go to:
Table of Contents
Installation
BEFORE YOU INSTALL: please read the prerequisites
npm install custom-template-generator
Once the plugin has been installed, just need to add this line:
var generator = ;
Usage
var generator = ; ;
Options
Scaffold | Type | Usage |
---|---|---|
componentName | string |
Name of the component |
customTemplatesUrl | string |
Location of the custom templates folder |
dest | string |
Destination of generated templates files |
templateName | string |
Template name |
autoIndent | boolean |
Default set to false, will indent the whole file. Only works with js and ts files. |
autoIndentExtensions | array |
The list of extensions file to indent. Default ['js', 'ts'] |
data | object |
This custom meta data can be injected in the custom template using '{}' |
Meta data
The meta data helps customize your templates, here are some options:
Name | Description |
---|---|
name | Component name |
Name | capitalized component name |
Demo
In this repository, use the demo
folder to test the generator. Here is the folder hierarchy:
To help customized the file name {component}
will be replace by the componentName defined in the generator parameters.
The following template {component}.interface.ts
:
// Angular imports;// Custom imports; ; /* * init */ : void;}
By running this function
;
Will generate this file
// Angular imports;// Custom imports;
License
MIT