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

@advait_thakar/logit-cmd

v1.1.4

Published

a simple logger for auditing your project directory

Downloads

94

Readme

@advait_thakar/logit-cmd

Overview

@advait_thakar/logit-cmd is a simple command-line logger for auditing and executing commands within your project directory. It enables structured logging of command executions, errors, and outputs, providing an efficient way to track terminal activity within a Node.js project.

Features

  • Execute shell commands within a custom CLI environment.
  • Automatically logs executed commands, errors, and outputs.
  • Supports execution in the root directory or a specified sub-directory.
  • Provides structured log files for auditing.
  • Supports real-time command execution.

Installation

To install the package, use:

npm install @advait_thakar/logit-cmd

Upon installation, necessary log files and configurations will be generated.


Setup

After installing the package, update your project's package.json by adding a script to run the Executor:

"scripts": {
  "dev": "node ./node_modules/@advait_thakar/logit-cmd/lib/Executor.js"
}

Additionally, ensure your package.json has:

"type": "module"

This avoids unnecessary warning spam in logs.


Usage

To start the Executor, run:

npm run dev

This launches the CLI executor in the root directory of your project. You can then enter commands interactively.

Command Execution

Inside the Executor, you can run shell commands with optional directory flags:

  • -r (default): Executes the command in the root directory of the project.
  • -d <sub_directory>: Executes the command in a specified sub-directory.

Examples:

node main.js -r

Runs the command in the root directory.

node main.js -d example_sub_directory

Runs the command in root/example_sub_directory.


Logging

Every command execution is logged with structured details, including:

  • Command executed
  • Execution directory
  • Status code
  • Output and errors

Logs are stored in:

root_directory/audit.log

Example log entry:

ID: abcd1234
Timestamp: 2025-02-26T12:34:56Z
Log-Level: info
Command: ls -la
Status-Code: 0
Directory: /path/to/project
Filename: commandExec.js
Output: total 12 ...
Error: No error
Cause: N/A
Stack-Trace: No stack trace available
----------------------------------------

Project Structure

@advait_thakar/
  --logit-cmd/
      --lib/
          --Executor.js      # Command execution and CLI interface
          --Logger.js        # Log management and file writing
          --Output.js        # Log formatting and structured output
      --scripts/
         --postinstall.js    # Runs after package installation
      --index.js            # Exports commandExecutor
      --package.json        # Package metadata and dependencies
      --README.md           # Documentation

API Documentation

Executor.js

Handles command execution and logging.

import { commandExecutor } from "./lib/Executor.js";

Logger.js

Manages log file writing.

import { addLog } from "./lib/Logger.js";

Output.js

Formats and outputs log entries.

import { Output } from "./lib/Output.js";

Future Enhancements

  • Adding more log management functionalities.
  • Implementing a log retrieval CLI tool.
  • Improving execution error handling.

Compatibility

Node.js: v20.x and above

Operating Systems: Windows, macOS, Linux

Shells: Bash, Zsh, PowerShell, Command Prompt


License

This project is licensed under the MIT License.


Author

advait_thakar