cli-alerts is a lightweight, cross-platform utility for Node.js command-line interfaces, designed to display formatted alerts with colored text and symbolic icons. It supports various alert types including success, info, warning, and error, ensuring consistent visual feedback across macOS, Linux, and Windows terminals. The current stable version is 2.0.0. While not following a strict time-based release cadence, the project maintains an active development status with periodic improvements and bug fixes. Its key differentiators include its simplicity, minimal dependencies, and direct focus on enhancing the user experience of CLI tools by providing clear, visually distinct messages without complex configurations, making it an excellent choice for developers looking to add immediate, actionable feedback to their scripts and applications.
npm install cli-alertsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use the 'alert' function for various message types with TypeScript.
Consult the project's official changelog (changelog.md within the repository) for a detailed list of breaking changes and migration steps before upgrading.
For ESM projects, use `import alert from 'cli-alerts';`. For CommonJS projects, stick to `const alert = require('cli-alerts');`. If you encounter `ERR_REQUIRE_ESM`, refactor your module imports to be consistent or ensure your environment supports interoperability (e.g., Node.js >=14 with appropriate flags or transpilation).If your project is ESM, change `const alert = require('cli-alerts');` to `import alert from 'cli-alerts';`. If your project is CommonJS, ensure `cli-alerts` itself is not an ESM-only package that's incompatible, or use a tool like `ts-node` or `esm` package for better interoperability.Verify your import statement matches the module's export style. For `cli-alerts`, in ESM, use `import alert from 'cli-alerts';` (default import). In CommonJS, use `const alert = require('cli-alerts');`.No dependency data recorded yet.