1.0.0 • Published 7 months ago
proconsole v1.0.0
ProConsole
Description
ProConsole is an npm library for creating colored messages in the console. It allows you to define dynamic methods to print messages with specific colors, improving the readability and organization of logs.
Installation
To install ProConsole, follow these steps:
- Install the library via npm:
npm install proconsole
Usage
To use ProConsole, follow these steps:
Import the library:
const proconsole = require('proconsole');
Create dynamic methods for colored messages:
// Create a method for error messages proconsole.create('error', 'red'); // Create a method for success messages proconsole.create('success', 'green');
Use the created methods:
proconsole.error('This is an error message'); proconsole.success('This is a success message');
Main Functions
create(name, color)
: Creates a new log method with the specified name and color.name
(string): The name of the log method to create.color
(string): The color of the message text.Example call:
proconsole.create('info', 'blue');
[name of the class](message)
: Prints the message in the class color.message
(string): The error message to print.Example call:
proconsole.error('This is an error message');
Example Usage
Here is an example of how to use ProConsole to create and use colored log methods:
const proconsole = require('proconsole');
// Create a method for warning messages
proconsole.create('warn', 'yellow');
// Use the created method to print a warning message
proconsole.warn('This is a warning message');
1.0.0
7 months ago