2.3.3 • Published 6 months ago

cl-print v2.3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

🌟 cl-print - Log with Filename & Line Number

cl-print is a lightweight and powerful npm package that enhances your console logging by automatically adding filename and line number to each log statement. With this package, debugging becomes a breeze as you can immediately see where your logs are coming from.


šŸš€ Features

  • ✨ Automatically prepends the filename and line number to every console.log statement.
  • šŸŽÆ No manual effort required to track logs.
  • šŸ› ļø Works out of the box, just replace console.log with clPrint.
  • šŸ§‘ā€šŸ’» Helps in debugging by providing clear and concise context.

šŸ“¦ Installation

You can easily install cl-print via npm:

npm install cl-print

šŸ–„ļø Usage

Once installed, just require or import the package and use it like you would use console.log.

Example

const {cl} = require('cl-print');

cl('Hello, World!'); 
// Output: [xyz.js:15] Hello, World!

In this example, the log message will display the filename (xyz.js) and the line number (15), showing exactly where the log was made.


šŸ’” Sample Output

Suppose you have a file app.js with the following code:

const {cl} = require('cl-print');

function greet() {
  cl('Hello, this is a test log!');
}

greet();

The output in your console will look like:

[app.js:4] Hello, this is a test log!

As you can see, it includes the filename (app.js) and the line number (4), making it incredibly easy to track the source of your log.


šŸ”„ Why Choose cl-print?

  • Instant Context: Get a clear picture of where your logs are being triggered without any extra effort.
  • Simplified Debugging: No more guessing or searching for log statements — it's all right there.
  • Zero Configuration: Just install and use it like console.log, and you're good to go.
  • Perfect for Teams: Everyone on the team can easily identify log origins, which improves collaboration and productivity.

šŸŽ‰ Quick Start

const {cl} = require('cl-print');

// Using it like console.log, but with filename and line number
cl('This is a log with context!');

Output:

[app.js:10] This is a log with context!

šŸ¤ Contributing

We welcome contributions! If you find bugs, or want to add features, feel free to fork the repository and submit a pull request. Here's how you can contribute:

  1. Fork this repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Make your changes
  4. Commit your changes (git commit -am 'Add new feature')
  5. Push to the branch (git push origin feature-branch)
  6. Submit a pull request

šŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for more details.


šŸ‘Øā€šŸ’» Author

Developed and maintained by Krishna Kumar. Feel free to reach out for questions, suggestions, or collaborations! šŸ˜„

šŸ”‘ Keywords console.log debugging log developer-tools debug filename line-number nodejs logging log-with-context nodejs-logging console-enhancer cl-print

2.3.3

6 months ago

2.3.2

6 months ago

2.3.1

6 months ago

2.2.5

6 months ago

2.2.4

6 months ago

1.1.8

6 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.1.4

6 months ago

2.1.3

6 months ago

2.1.0

6 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago