CLI Welcome Header

3.0.1 · active · verified Wed Apr 22

cli-welcome is a Node.js library specifically designed for creating customizable welcome headers in Command Line Interface (CLI) applications. It allows developers to display essential information such as the application's title, a tagline, a description, and its version number. The library provides styling options including configurable background and text colors, and text bolding. Currently stable at version 3.0.1, the package maintains an active release cadence with frequent patch and minor updates, while major versions introduce more significant changes. It ships with comprehensive TypeScript type definitions, ensuring seamless integration and type-safety within modern TypeScript projects. Its primary differentiator is simplifying the process of establishing a consistent, branded, and informative initial display for CLI tools without requiring extensive manual console styling or external dependencies.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use `cli-welcome` with dynamic application details from `package.json`.

import welcome from 'cli-welcome';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';

// Dynamically load package.json for application details.
const packageJsonPath = join(process.cwd(), 'package.json');
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));

welcome({
  title: packageJson.name || 'My CLI App',
  tagLine: 'A powerful tool for your daily tasks',
  description: packageJson.description || 'This CLI helps you manage your projects efficiently.',
  bgColor: '#6A788D',
  color: '#ffffff',
  bold: true,
  clear: true,
  version: `v${packageJson.version}`
});

console.log('Your CLI application logic starts here...');

view raw JSON →