Oct 12, 2021

Echo

The @mikosoft/echo npm library simplifies console logging and event emitting in JavaScript applications by enabling the printing of formatted messages, warnings, errors, objects, and even images with ease.

This npm library enhances the debugging and logging process in JavaScript applications. It allows developers to send various types of messages, including informative logs, warnings, error reports, and even images, to both the console and external event emitters. This streamlines the debugging and monitoring of applications, making it a valuable tool for improving code quality and troubleshooting.

Installation

$ npm install @mikosoft/echo

Application in DEX8 Platform

The DEX8 platform uses the @mikosoft/echo library to send echo messages to the Web Panel. This allows users to see the progress of their skript executions and any errors that may occur.

The echo messages are sent in JSON format and contain the following information:

  • The type of message (log, warn, error, or image)
  • The message text
  • The time the message was sent

The echo messages are received by the Web Panel and displayed in the log window. This allows users to easily track the progress of their tasks and troubleshoot any problems that may occur in real-time.

The @mikosoft/echo library is a useful tool for debugging and logging purposes. It is easy to use and supports a variety of message types, including images. This makes it a good choice for the DEX8 platform, which needs to be able to send a variety of messages to the Web Panel.

Key Features

  • Colored messages: The library supports colored messages, which can be useful for making the messages more visually appealing and easy to distinguish.
  • Event emitter: The library supports an event emitter, which can be used to listen for messages in other parts of the code. This can be useful for debugging or logging purposes.
  • Image support: The library supports image support, which can be used to print images to the console. This can be useful for receiving captchas or screenshots.

Links

  1. https://www.npmjs.com/package/@mikosoft/echo
  2. https://github.com/miko-soft/echo