npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

logginglogger

v1.0.1

Published

A lightweight, colorful TypeScript logger for Node.js with success, error, warning, and info logging utilities powered by Chalk.

Downloads

0

Readme

logginglogger

A simple, colorful, and lightweight logging utility for Node.js built with TypeScript and Chalk.

logginglogger provides four logging methods — successLog, errorLog, warningLog, and infoLog — to display clear, color-coded console messages.

✨ Features

  • 🟢 Success logs — Green, bold messages for successful operations.
  • 🔴 Error logs — Red, bold messages for errors and failures.
  • 🟡 Warning logs — Yellow, bold messages for warnings.
  • 🔵 Info logs — Cyan, bold messages for informational updates.
  • 🎨 Colored output powered by Chalk.
  • 📏 Dynamic log separators based on message length, capped at 80 characters.
  • ⚡ Default messages when no message is provided.
  • 📦 Written in TypeScript with type-safe action names.

📦 Installation

Install the package:

npm install logginglogger

🚀 Usage

Import the logging functions into your project:

import { successLog, errorLog, warningLog, infoLog } from "logginglogger";

successLog("Server started successfully");
errorLog("Database connection failed");
warningLog("Proceed with caution");
infoLog("Waiting for incoming requests");

💡 Examples

1. Server Startup

Use logging messages to indicate when your application starts.

import { successLog, infoLog } from "logginglogger";

infoLog("Starting server...");
successLog("Server is running on port 4000");

2. Database Connection

Log successful database connections and connection failures.

import mongoose from "mongoose";
import { successLog, errorLog } from "logginglogger";

mongoose
  .connect(process.env.DB!)
  .then(() => {
    successLog("Database connected successfully");
  })
  .catch((error) => {
    errorLog(`Database connection failed: ${error.message}`);
  });

3. API Request Handling

Display informational messages when handling API requests.

import express from "express";
import { infoLog, successLog, errorLog } from "logginglogger";

const app = express();

app.get("/api/users", (req, res) => {
  infoLog("GET /api/users");

  try {
    const users = [{ id: 1, name: "John" }];

    successLog("Users fetched successfully");
    res.json(users);
  } catch {
    errorLog("Failed to fetch users");
    res.status(500).json({ message: "Internal server error" });
  }
});

app.listen(4000, () => {
  successLog("API server started on port 4000");
});

4. Input Validation

Use warnings to indicate missing or invalid input.

import { warningLog, successLog } from "logginglogger";

const username = "Sujit";

if (!username) {
  warningLog("Username is required");
} else {
  successLog("Username validation passed");
}

5. Default Messages

Each logging function has a default message, so you can call it without arguments.

successLog();
// Operation Completed Successfully

errorLog();
// Something went wrong during execution

warningLog();
// Proceed with caution

infoLog();
// Awaiting Response

🎨 Log Types

| Function | Color | Default Message | | -------------- | ------ | ------------------------------------- | | successLog() | Green | Operation Completed Successfully | | errorLog() | Red | Something went wrong during execution | | warningLog() | Yellow | Proceed with caution | | infoLog() | Cyan | Awaiting Response |

🖥️ Example Output

The terminal displays a colored message surrounded by matching separators.

--------------------------------------------------
SUCCESS - Server started successfully
--------------------------------------------------

The separator length depends on the message length, up to 80 characters. Colors are applied in the terminal using Chalk.

⚙️ How It Works

The logger uses a shared handler() function to format all messages.

  1. Calculate the separator length based on the message and action lengths.
  2. Limit the separator to a maximum of 80 characters.
  3. Apply colors using Chalk's color and formatting methods.
  4. Print the output with a separator above and below the log message.

The supported action types are:

type ActionType = "SUCCESS" | "ERROR" | "WARNING" | "INFO";

🛠️ Technologies Used

📁 Project Structure

logginglogger/
├── src/
│   └── index.ts
├── dist/
│   ├── index.js
│   └── index.d.ts
├── package.json
├── tsconfig.json
├── README.md
└── .gitignore

📋 Requirements

  • Node.js
  • npm

TypeScript is required when developing the package from source.

🤝 Contributing

Contributions, bug reports, and feature suggestions are welcome.

  1. Fork the repository.
  2. Create a feature branch.
  3. Make your changes.
  4. Submit a pull request.

📄 License

This project is licensed under the ISC License.


logginglogger — Make your terminal logs clear, colorful, and easy to read.