Registry / observability / leprechaun

leprechaun

JSON →
library1.0.0jsnpmunverified

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.

npm install leprechaun
INSTALL
IMPORT
SIG · LEPRECHAUN
L
leprechaun
observabilityjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

info
import { info } from 'leprechaun';
const { info } = require('leprechaun');
Leprechaun is an ESM-only package since v1.0.0, requiring `import` syntax. It ships with TypeScript types.
success, warning, error
import { success, warning, error } from 'leprechaun';
import leprechaun from 'leprechaun'; leprechaun.success(...);
All logging functions are named exports; there is no default export.
All logging functions
import { info, success, warning, error } from 'leprechaun';
const { info, success, warning, error } = require('leprechaun');
Use this pattern to import all available logging functions for console output.

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.

import { info, success, warning, error } from 'leprechaun'; const project = 'MyCLIApp'; const version = '1.0.0'; const featureEnabled = true; info('Starting', project, 'v' + version); success('Configuration loaded:', featureEnabled ? 'enabled' : 'disabled'); warning('Check for updates recommended for', project); error('Failed to connect to service. Retrying...');
Debug
Known issues
breakingVersion 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.
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.
affects: >=1.0.0
breakingThe 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.
fix
Verify that your type imports and usage remain compatible. If you encounter type errors, consult the bundled type definitions or report an issue.
affects: >=1.0.0
gotchaAs 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.
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.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/leprechaun/index.js from ... not supported.
Attempting to import `leprechaun` using CommonJS `require()` syntax in a project that expects ESM.
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).
The package 'leprechaun' requires Node.js version >=20.0.0. The current active Node.js version is X.Y.Z.
Running `leprechaun` on a Node.js version older than 20.0.0, which is unsupported by the package.
fix
Upgrade your Node.js runtime to version 20.0.0 or newer using a version manager like `nvm` or `volta`.
ReferenceError: info is not defined (or similar for other functions)
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.
fix
Ensure you are using `import { info, success, warning, error } from 'leprechaun';` and your environment supports ESM.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
leprechaun — npm install leprechaun · libregistry