Code generation and scaffolding are techniques that automate the creation of boilerplate code, project structure, and repetitive patterns through template engines, AST manipulation, and schema-driven approaches. These tools transform high-level specifications into executable code, dramatically reducing manual work while maintaining consistency across large codebases. The key insight: good generators don't just save time—they encode architectural decisions and team conventions into reusable, version-controlled artifacts that evolve with your project.
What This Cheat Sheet Covers
This topic spans 20 focused tables and 104 indexed concepts, 95 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Project Scaffolding Generators
These are the tools you reach for when starting something new — bootstrapping an entire project or stamping out a component, route, or library inside an existing one. They range from broad ecosystems like Yeoman to opinionated full-stack starters like create-t3-app, but all share one job: turn a few prompts into a working file structure so you never write boilerplate by hand.
| Tool | Example | Description | |
|---|---|---|---|
yo webappyo generator-node | • CLI scaffolding system with vast ecosystem of community generators • uses Inquirer.js prompts and template-based file generation for bootstrapping entire projects | ||
plop component MyButtonplop api-route users | • Micro-generator framework using Handlebars templates • ideal for generating components, routes, or files within existing projects with custom prompts | ||
hygen component newhygen init self | • Fast, scalable generator with shell-based templates • stores generators in _templates/ folder and supports conditional file generation based on prompts | ||
nx g /react:componentnx workspace-generator my-gen | • Built-in code generation for Nx monorepos • creates applications, libraries, and custom workspace-specific generators with atomic changes | ||
ng generate component userng g service auth | • Template-based code generators for Angular • uses virtual file system to preview changes before applying and supports custom schematics via AST manipulation | ||
npm create vite@latestnpx create-next-app | • Modern React project bootstrapping tools • Vite offers fast dev server with HMR, Next.js provides full-stack framework with routing built-in | ||
npm create t3-app@latestpnpm dlx create-t3-app | • Opinionated Next.js starter with tRPC, Prisma, NextAuth, and Tailwind pre-configured • generates type-safe full-stack applications with best practices |