1.0.0 • Published 1 year ago

console-log-counter v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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.

1.0.0

1 year ago