Socket
Socket
Sign inDemoInstall

mx-template-generator

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mx-template-generator

react script helpers


Version published
Weekly downloads
131
increased by52.33%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

mx-template-generator

NPM package that you can use to create your own template files

how to install

npm i mx-template-generator -global

#how to setup

  1. 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 to template
      module.exports = {
        template: {},
        template2: {},
        template3: {}
      }
      
    • scheme for folder :
      {
        name: '<FOLDER>',
        type: 'folder',
        files: []
      }
      
    • scheme for file:
      {
        name: '<FILENAME>',
        type: 'file',
        location: '<PATH OF THE FILE LOCATION FROM THE TEMPLATES>'
      }
      
  • lib/templates/config.js Screen Shot 2022-06-24 at 11 29 27 AM]
  1. File Creation
  • ${fileName} will be replaced by the filename supplied from the command --name Screen Shot 2022-06-22 at 7 48 42 AM
  1. set the destination path of config
  • locate settings.json inside the npm package
  • change it to the location the config.js is located Screen Shot 2022-06-22 at 7 46 57 AM

#how to use

  1. open terminal or cmd
  2. locate the directory where you want to create your files
  • example: cd /Volumes/Passport/projects/sample-redux-toolkit/sampleApp/src/feature
  1. write mx-template-generator --name="ADD YOUR FILENAME HERE"
  2. npm package will automatically create the files from the config.js provided
  3. the name of the folder will have the first letter in lowercase
  • example: --name="SampleFolder" foldername will be sampleFolder

Commands

  • 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
    • NOTE:

      • 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

Others

feel free to message me here on https://github.com/moribaleta/ if there are any other concerns create an issue ticket

FAQs

Last updated on 13 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc