{"id":11234,"library":"leprechaun","title":"Leprechaun CLI Logger","description":"Leprechaun is a specialized logging utility designed for command-line interface (CLI) applications, providing simple, lightweight, and visually distinct output. It offers `info`, `success`, `warning`, and `error` functions, each prepending messages with appropriate colored icons, enhancing readability and user experience in console environments. The package is currently at version 1.0.0, having recently migrated to TypeScript, which indicates a focus on type safety and maintainability. Its release cadence is not yet established, with 1.0.0 being the first major stable release. A key differentiator is its emphasis on aesthetics and a minimal API, making it easy to integrate for developers who prioritize clear, color-coded CLI feedback without extensive configuration.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/websperts/leprechaun","tags":["javascript","leprechaun","log","typescript"],"install":[{"cmd":"npm install leprechaun","lang":"bash","label":"npm"},{"cmd":"yarn add leprechaun","lang":"bash","label":"yarn"},{"cmd":"pnpm add leprechaun","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Leprechaun is an ESM-only package since v1.0.0, requiring `import` syntax. It ships with TypeScript types.","wrong":"const { info } = require('leprechaun');","symbol":"info","correct":"import { info } from 'leprechaun';"},{"note":"All logging functions are named exports; there is no default export.","wrong":"import leprechaun from 'leprechaun'; leprechaun.success(...);","symbol":"success, warning, error","correct":"import { success, warning, error } from 'leprechaun';"},{"note":"Use this pattern to import all available logging functions for console output.","wrong":"const { info, success, warning, error } = require('leprechaun');","symbol":"All logging functions","correct":"import { info, success, warning, error } from 'leprechaun';"}],"quickstart":{"code":"import { info, success, warning, error } from 'leprechaun';\n\nconst project = 'MyCLIApp';\nconst version = '1.0.0';\nconst featureEnabled = true;\n\ninfo('Starting', project, 'v' + version);\nsuccess('Configuration loaded:', featureEnabled ? 'enabled' : 'disabled');\nwarning('Check for updates recommended for', project);\nerror('Failed to connect to service. Retrying...');","lang":"typescript","description":"This quickstart demonstrates how to import and use all four primary logging functions (`info`, `success`, `warning`, `error`) to display diverse messages with appropriate colorful icons in a CLI application."},"warnings":[{"fix":"Upgrade your Node.js environment to version 20.0.0 or higher, or use an earlier version of Leprechaun (if available and compatible) at your own risk.","message":"Version 1.0.0 introduced a minimum Node.js requirement of `>=20.0.0`. Projects running on older Node.js versions must upgrade to use Leprechaun v1.0.0 and above.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Verify that your type imports and usage remain compatible. If you encounter type errors, consult the bundled type definitions or report an issue.","message":"The package migrated to TypeScript in version 1.0.0. While the primary API remains consistent, this may introduce changes to type definitions or internal module structure that could subtly affect existing JavaScript consumers or custom type declarations.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Exercise caution when relying on undocumented features. Consider reviewing the source code for deeper understanding and contribute to the project's documentation and testing efforts if possible.","message":"As indicated by the `TODO` section in the README, Leprechaun currently lacks comprehensive documentation and tests. This could lead to unexpected behavior in edge cases, difficulty understanding advanced usage patterns, or instability in future updates.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change `const { info } = require('leprechaun');` to `import { info } from 'leprechaun';` and ensure your project is configured for ESM (e.g., `\"type\": \"module\"` in package.json).","cause":"Attempting to import `leprechaun` using CommonJS `require()` syntax in a project that expects ESM.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/leprechaun/index.js from ... not supported."},{"fix":"Upgrade your Node.js runtime to version 20.0.0 or newer using a version manager like `nvm` or `volta`.","cause":"Running `leprechaun` on a Node.js version older than 20.0.0, which is unsupported by the package.","error":"The package 'leprechaun' requires Node.js version >=20.0.0. The current active Node.js version is X.Y.Z."},{"fix":"Ensure you are using `import { info, success, warning, error } from 'leprechaun';` and your environment supports ESM.","cause":"This usually indicates an incorrect import statement, either trying to import a non-existent default export or an incorrect named export from a CommonJS context.","error":"ReferenceError: info is not defined (or similar for other functions)"}],"ecosystem":"npm"}