console-log-counter

1.0.0 • Public • Published

README.md

Console Log Counter

A simple Node.js module to count the occurrences of console.log and console.table statements in a JavaScript file.

Installation

You can install the package via npm:

npm install console-log-counter

Usage

  1. Import the findConsoleCount function from the package:
const { findConsoleCount } = require("console-log-counter");
  1. Call the findConsoleCount function with the path to the JavaScript file you want to analyze:
const result = findConsoleCount("/path/to/your/file.js");
  1. The function returns an object containing the count of console.log and console.table statements, as well as an array of line numbers and corresponding lines where these statements occur:
console.log("Number of console.log and console.table statements:", result.countLines);
console.log("Lines with console.log and console.table:", result.consoleLogLines);

Example

const { findConsoleCount } = require("console-log-counter");

const filePath = "/path/to/your/file.js";
const result = findConsoleCount(filePath);

console.log("Number of console.log and console.table statements:", result.countLines);
console.log("Lines with console.log and console.table:", result.consoleLogLines);

License

This project is licensed under the MIT License - see the LICENSE file for details.


This README provides an overview of the console-log-counter package, including installation instructions, usage examples, and license information. Feel free to customize it further to fit your needs or add more detailed documentation as required.

Readme

Keywords

Package Sidebar

Install

npm i console-log-counter

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.51 kB

Total Files

3

Last publish

Collaborators

  • nexusrk