@zahra633/inklog
v1.0.0
Published
A colorful and beautiful terminal logger for Node.js with fixed-width output and icons
Downloads
51
Maintainers
Readme
@zahra633/inklog
A lightweight, beautiful, and fully typed terminal logger for Node.js. inklog creates neatly formatted, colored boxes around your terminal messages using chalk, complete with status icons and automatic text wrapping so your logs never break terminal layout!
Features
- 🎨 Beautiful Formatting: Automatically wraps text in elegant ASCII box-drawing characters.
- 📐 Smart Word Wrapping: Detects your terminal width automatically and wraps long text without splitting words visually.
- 🚦 Status Icons: Built-in recognizable prefixes for different log levels (✔, ✖, ⚠, ℹ).
- 🌈 Color Coded: Uses
chalkto colorize boxes based on the tone of your message (Green, Red, Yellow, Blue). - 📦 Zero-Config: Works out of the box with zero setup required.
- 🛡️ TypeScript Ready: Written in TypeScript to provide excellent autocomplete and type definitions.
Installation
You can install it via npm:
npm install @zahra633/inklogUsage
You can import specific logging functions or the default object.
Import Functions Individually
import { successLog, errorLog, warningLog, infoLog } from "@zahra633/inklog";
successLog("Database connection established successfully!");
errorLog("Failed to authenticate user: Invalid credentials.");
warningLog("API rate limit is approaching.");
infoLog("Server is running on port 3000.");Import as Default Object
import inklog from "@zahra633/inklog";
inklog.successLog("User profile updated!");
// Works effortlessly with long strings and JSON objects:
inklog.infoLog(
"This is a really long log message that is going to be dynamically wrapped based on your system's current terminal width without causing any overflow issues or messing up the box design whatsoever."
);
inklog.warningLog({ message: "You can even pass objects and get formatted JSON out!", status: 400 });API Reference
successLog(msg: any)
Prints a green box with a checkmark (✔) icon. Ideal for success events.
errorLog(msg: any)
Prints a red box with an X (✖) icon. Ideal for error events and exceptions.
warningLog(msg: any)
Prints a yellow box with a warning (⚠) icon. Ideal for deprecations and warnings.
infoLog(msg: any)
Prints a blue box with an info (ℹ) icon. Ideal for general logging and status updates.
License
ISC License
