npm i mx-template-generator -global
#how to setup
- create config file
mx-template-generator
supports nested folder structure- your
config.js
file can support multiple templates- NOTE: if
--template
is not given it will default totemplate
module.exports = { template: {}, template2: {}, template3: {} }
- NOTE: if
- scheme for folder :
{ name: '<FOLDER>', type: 'folder', files: [] }
- scheme for file:
{ name: '<FILENAME>', type: 'file', location: '<PATH OF THE FILE LOCATION FROM THE TEMPLATES>' }
- your
- lib/templates/config.js ]
- File Creation
- set the destination path of config
#how to use
- open terminal or cmd
- locate the directory where you want to create your files
- example:
cd /Volumes/Passport/projects/sample-redux-toolkit/sampleApp/src/feature
- write
mx-template-generator --name="ADD YOUR FILENAME HERE"
- npm package will automatically create the files from the
config.js
provided - the name of the folder will have the first letter in lowercase
- example:
--name="SampleFolder"
foldername will besampleFolder
mx-template-generate
- used to execute the file creation
--name
- used to define the name, folder and class name
--template
- used to specify the template to use
--force
- used to override file creation
--debug
- this will display console log messages
--config
- this will set the path of the config file given
-
- this is only intended for local node project install not
global
- this will locate the root node project path and append the config path given
- this is only intended for local node project install not
feel free to message me here on https://github.com/moribaleta/ if there are any other concerns create an issue ticket