Create a new React component with all its files in one command instead of copying boilerplate from an existing file
Inject a new route or Redux reducer into an existing file at a specific insertion point automatically
Share code generators with your whole team by checking the _templates folder into your Git repository
Scaffold an API endpoint with test file and types in one command whenever you add a new feature
Hygen is a command-line code generator that lives inside your project folder. Instead of writing the same boilerplate files by hand each time you add a component, a route, or another repeated structure, you define a template once and then run a short command to generate new files from it. The generated files appear in your project automatically, ready to edit. The tool stores templates in a folder called _templates within your project, which you check into version control alongside your code. This means the whole team shares the same generators, and they evolve with the project rather than living in a separate tool that gets out of sync. Templates use a format called EJS, which is a simple way to embed variables and logic inside otherwise ordinary text files. Hygen can do more than create new files. It can inject content into existing files at a specific point, run shell commands as part of a generation step, and prompt the user for input before generating anything. This covers a wide range of repetitive tasks: adding a new Redux reducer, scaffolding a new API endpoint, or creating a test file whenever a new module is added. Installing it takes one command via npm, Homebrew, or npx. Once installed, you run hygen init self in your project to set it up, then hygen generator new to create your first template. The quickstart in the README walks through this in a few minutes. The project also supports initializing from a GitHub repository template with a single command. Hygen is used by companies including Airbnb, Accenture, and Wix according to the README's credits section. It is available on npm and licensed as open source. Full documentation is available at hygen.io.
← jondot on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.