Cross-Platform CLI for Terminal Output

2.0.0 · active · verified Wed Apr 22

echo-cli is a utility designed to address inconsistencies in command-line output across different operating systems, particularly focusing on the limitations of Windows CMD regarding escape sequences and newline characters. It provides a cross-platform solution for outputting text to the terminal, supporting all standard JavaScript escape sequences. This makes it particularly useful for `npm scripts` and other automation tasks where consistent terminal output, including formatted text and newlines, is crucial regardless of the underlying shell. The current stable version is 2.0.0, released after dropping a dependency on `meow`. The package does not have a defined public release cadence but is actively maintained to ensure its core functionality.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates `echo-cli` usage within `package.json` scripts to output formatted messages with escape sequences before and after build tasks, ensuring consistent output across platforms.

{
  "name": "my-project",
  "version": "1.0.0",
  "scripts": {
    "prebuild": "echo-cli 'Starting build process...\n'",
    "build": "npm run prebuild && echo-cli 'Compiling code...\t(This might take a moment)' && sleep 1 && echo-cli '\nBuild complete! 🎉'",
    "test": "echo-cli 'Running tests...\n' && npm test"
  },
  "devDependencies": {
    "echo-cli": "^2.0.0"
  }
}

view raw JSON →