
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
code-template-generator
Advanced tools
(*) Tips and tricks for the project templates
You like to build yourself development environment and install only what you need in your project. You want to know how it works and have more controll as much as possible. Sometimes you just want to have a little tool to show an idea. The application gives you a step on your way and it makes your life more exciting. (^_~)
The application is a lightweight Node.js CLI tool that is using for front-end web development with React. Main features:

git init command and generation of a .gitignore file while the project is generated from a chosen template./src/index.html./dist. The things you care are only the directory /src..gitignore file generation.| Templates | Main dependencies |
|---|---|
| react-hooks | React Hooks, Babel |
| react-sass | React Hooks, Babel and SASS |
| react-typescript | React Hooks, TypeScript, ts-loader |
You can view more details and other project templates in the repository Build environments.
| Component | Single (*) | Full (**) | Description |
|---|---|---|---|
| Plain JavaScript | *.js | *.css, *.js | Can using *.jsx |
| TypeScript | *.tsx | *.css, *.tsx |
(*) Single component is a JavaScript file with these supported extensions: *.js, *.jsx, *.ts and *.tsx.
(**) Full component is a directory with two files are within: a CSS file and a JS file (*.js, *.jsx, *.tsx).
You can retrieve your own assets from a directory on local.
Reasons:

(You can view how to use and the examples are below for more details)
$ npm install --global code-template-generator
System requirements:
code-template-generator on global by using the option --global.generate --update for the latest stable version updating.$ generate [-option] [--sub-option] [project-name][component-name][path]
Tip! You can use the command gen instead of generate from version 2.2.x. It's more quickly when you enter a command line.
Examples:
generate -v -> Main command.gen -v -> Short command.| Option | Used with | Description |
|---|---|---|
| - | <project-name> | Generate a new project from a chosen template without Git support. |
-g | <project-name> | Run automatically the git init command and generate a .gitignore file on the root of project directory during the generation. |
-c | <component-name>.<extension> | Generate a single React component in the current directory (*.js, *.jsx, *.ts, *.tsx). |
-f | <component-name> | Generate a full React component in the current directory (*.js, *.jsx, *.tsx). |
-i | - | A .gitignore file will be generated in the current directory. |
-v | - | View the installed version. |
-help | - | View help documentation. |
-u | - | Automatic update checking and installation for the latest stable version. (*) |
-cf | (**) | Using with one of these sub options: --set-asset, --view-asset. |
-a | - | Show a list to retrieve chosen asset(s) into the current work directory. |
(*) Administrator permission is required by your operating system. Here are the examples for MacOS and Ubuntu systems by using sudo:
$ sudo generate -u$ sudo generate --update (Using alias)(**) View how to use with its sub options that are below.
--no-install (No install dependencies)--set-asset (Set a local path to the asset directory)--view-asset (View the current local path to the asset directory)--jsx (Using *.jsx instead of *.js)--tsx (Using *.tsx instead of *.js)| Option | Sub option | Used with | Description |
|---|---|---|---|
| - | --no-install | <project-name> | Generate a project without both running the git init command and installation of dependencies. |
-g | --no-install | <project-name> | Generate a project with running the git init command but without installation of dependencies. |
-cf | --set-asset | <local-path> | Store a local path to the asset directory into the application config file. |
-cf | --view-asset | - | View the current asset path. |
-f | --jsx | <component-name> | The application creates a *.jsx file instead of a *.js file that is default when it generates a full component. |
-f | --tsx | <component-name> | The application creates a *.tsx file instead of a *.js file that is default when it generates a full component. |
| Option | Alias |
|---|---|
-g | --git |
-c | --component |
-f | --full-component |
-i | --gitignore |
-v | --version |
-help | --help |
-u | --update |
-cf | --config |
-a | --asset |
// Project generation
$ generate first-project // Generates a project without any options
$ generate -g secondproject // With Git support by running 'git init'
$ generate --git ThirdProject // Using alias --git instead of -g
$ generate -g --no-install OtherProject
$ generate --no-install LastProject // No install dependencies
// Single component -> A JavaScript file
$ generate -c SearchService.js
$ generate -c ReviewComponent.jsx
$ generate -c CountService.ts
$ generate -c CounterComponent.tsx
// Full component
// -> A directory with two files are within (*.css, *.js|jsx|tsx)
$ generate -f Product // Default is using *.js
$ generate -f --jsx Cart // Using *.jsx
$ generate -f --tsx Counter // Using *.tsx
// Asset generation
$ generate -cf --set-asset "C:\Users\name\myassets" // Windows
$ generate -cf --set-asset "/Users/name/myassets" // MacOS
$ generate -cf --set-asset "/home/name/myassets" // Ubuntu
$ generate -cf --view-asset // View info about the current asset location
$ generate -a // Show the asset list and retrieve them
// Others
$ generate -i // Generate a .gitignore file
$ generate -v // View the installed version
$ generate -help // View help documentation
$ generate -u // Install the latest stable version
Special thanks to Harriet Ryder!
Many thanks to Commander.js for the inspiration.
FAQs
The lightweight React code template generator
The npm package code-template-generator receives a total of 232 weekly downloads. As such, code-template-generator popularity was classified as not popular.
We found that code-template-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.