Scripts2026年5月29日·1 分钟阅读

Yeoman — Scaffolding Tool for Modern Web Applications

A command-line scaffolding system that uses community generators to create project boilerplates for any web stack or framework.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
Yeoman Overview
直接安装命令
npx -y tokrepo@latest install bade276e-5b9b-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

Yeoman is a command-line scaffolding tool that generates project boilerplates from reusable templates called generators. Rather than copying starter repos manually, Yeoman provides an interactive prompt-driven workflow that configures the output based on your choices. Thousands of community generators exist for React, Angular, Node.js, and many other stacks.

What Yeoman Does

  • Scaffolds new projects from interactive generator templates
  • Provides a consistent CLI interface across all generator types
  • Supports composable sub-generators for adding features to existing projects
  • Manages file conflicts when re-running generators on existing codebases
  • Offers a generator authoring API for building custom scaffolding workflows

Architecture Overview

Yeoman's core (yo) is a runner that discovers and executes generator packages installed via npm. Each generator is a Node.js module that extends Yeoman's Base class and defines a priority-based run loop (initializing, prompting, configuring, writing, install). The templating layer supports EJS by default, and the file system abstraction handles conflict resolution when generating into non-empty directories.

Self-Hosting & Configuration

  • Install yo globally via npm to get the Yeoman CLI
  • Install generators individually from npm (e.g., generator-react, generator-node)
  • Create custom generators using the generator-generator bootstrapper
  • Store user preferences in .yo-rc.json for reproducible scaffolding
  • Share private generators via npm private registry or local file paths

Key Features

  • Thousands of community generators covering most frameworks and languages
  • Interactive prompts that customize generated output per project
  • Composability for combining multiple generators in a single run
  • Conflict resolution for safely re-running generators on existing projects
  • Generator authoring API with built-in testing utilities

Comparison with Similar Tools

  • Create React App / create-next-app — single-framework scaffolders; Yeoman is framework-agnostic
  • Hygen — template-based with simpler conventions; Yeoman offers richer interactive prompts
  • Plop — micro-generator for adding files to existing projects; Yeoman scaffolds entire projects
  • Cookiecutter — Python-based templating; Yeoman is Node.js-native with npm distribution

FAQ

Q: Is Yeoman still relevant with modern framework CLIs? A: Yeoman remains useful for custom enterprise scaffolding, multi-framework teams, and scenarios where framework-specific CLIs are too opinionated.

Q: How do I create my own generator? A: Run yo generator-generator to scaffold a new generator project, then implement the prompting and writing methods.

Q: Can I use Yeoman for non-JavaScript projects? A: Yes. Generators can scaffold any file type. Community generators exist for Go, Python, Java, and infrastructure-as-code projects.

Q: Does Yeoman install dependencies automatically? A: By default, generators run npm install or yarn after scaffolding. This behavior is configurable per generator.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产