{"id":17079,"library":"yeoman-character","title":"Yeoman Character for CLI","description":"The `yeoman-character` package provides a customizable, multi-line ASCII art representation of the Yeoman mascot for command-line interfaces. The current stable version is 2.0.0, which introduced significant breaking changes by moving to pure ES Modules and requiring Node.js 18. As a focused utility package for a specific visual element, its release cadence is typically slow, primarily addressing compatibility updates rather than frequent feature additions. Its key differentiator is its singular purpose: delivering the iconic Yeoman character simply and effectively to any Node.js CLI, making it a staple for branding tools within the Yeoman ecosystem or for adding a distinctive visual flair to console output.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/yeoman/yeoman-character","tags":["javascript","cli-app","cli","bin","yeoman","character","figure","logo","color"],"install":[{"cmd":"npm install yeoman-character","lang":"bash","label":"npm"},{"cmd":"yarn add yeoman-character","lang":"bash","label":"yarn"},{"cmd":"pnpm add yeoman-character","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is pure ES Modules (ESM) since v2.0.0. CommonJS `require()` is no longer supported directly. For CJS environments, dynamic `import()` is required.","wrong":"const yeomanCharacter = require('yeoman-character');","symbol":"yeomanCharacter","correct":"import yeomanCharacter from 'yeoman-character';"}],"quickstart":{"code":"// To run this example:\n// 1. Ensure your Node.js version is 18 or higher.\n// 2. Save this code as `index.mjs` (note the `.mjs` extension for ESM).\n// 3. In your project directory, run: `npm install yeoman-character`\n// 4. Then execute from your terminal: `node index.mjs`\n\nimport yeomanCharacter from 'yeoman-character';\n\nconsole.log(\"-----------------------------------------\");\nconsole.log(\"  Displaying the Yeoman Character:\");\nconsole.log(\"-----------------------------------------\");\n\n// The `yeomanCharacter` export is a simple multiline string containing\n// the ASCII art representation of the Yeoman mascot. While the character\n// itself does not contain ANSI color codes by default in this package\n// version, it is commonly used with terminal coloring libraries\n// like 'chalk' or 'picocolors' for visual effect in CLIs.\nconsole.log(yeomanCharacter);\n\nconsole.log(\"\\nThis character can also be displayed directly via its CLI:\");\nconsole.log(\"To install globally: `npm install --global yeoman-character`\");\nconsole.log(\"Then run from any terminal: `yeoman-character`\");\nconsole.log(\"-----------------------------------------\");","lang":"javascript","description":"Demonstrates how to import and log the Yeoman character string using ES Modules, including setup instructions for ESM, and mentions the global CLI usage."},"warnings":[{"fix":"Migrate your codebase to use ES Modules (e.g., `\"type\": \"module\"` in `package.json` or `.mjs` file extension). If you must use it in a CJS environment, consider dynamic `import()` (e.g., `import('yeoman-character').then(mod => console.log(mod.default))`).","message":"This package is now pure ES Modules (ESM) and no longer supports CommonJS `require()` directly.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade your Node.js environment to version 18 or newer to ensure compatibility and prevent runtime errors.","message":"The minimum required Node.js version has been increased to 18.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"To display the character with colors, you will need to apply a terminal coloring library (e.g., `chalk`, `picocolors`) to the string yourself, such as `console.log(chalk.blue(yeomanCharacter))`.","message":"The exported `yeomanCharacter` string does not contain ANSI color codes by default in v2.x, despite screenshots often showing a colored character.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Change `require('yeoman-character')` to `import yeomanCharacter from 'yeoman-character';` and ensure your project uses ES Modules (e.g., by setting `\"type\": \"module\"` in `package.json` or using `.mjs` file extensions). For CJS compatibility, use `import('yeoman-character').then(mod => console.log(mod.default))`.","cause":"Attempting to use `require('yeoman-character')` in a CommonJS file when the package is pure ES Modules.","error":"ERR_REQUIRE_ESM"},{"fix":"Ensure the file using `import` is treated as an ES Module by either renaming it to `.mjs` or by adding `\"type\": \"module\"` to your project's `package.json`.","cause":"Attempting to use ES `import` syntax (e.g., `import yeomanCharacter from 'yeoman-character';`) in a file that is being interpreted as CommonJS.","error":"SyntaxError: Cannot use import statement outside a module"}],"ecosystem":"npm","meta_description":null}