npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mikosoft/echo

v1.3.0

Published

Output messages to the console while simultaneously dispatching them through an event emitter.

Readme

@mikosoft/echo

📢 A lightweight Node.js logging utility for console output and event-based messaging.

@mikosoft/echo prints nicely formatted, time-stamped logs to the console and can emit the same messages through a Node.js EventEmitter.
It also keeps an in-memory history of all logs via allEchoes.


✨ Features

  • Colored console logs (log, warn, error, object, question)
  • Optional EventEmitter integration
  • Async-safe logging with configurable delay
  • Interactive question() / answer flow
  • Automatic log history (allEchoes)
  • Zero dependencies beyond chalk and moment

📦 Installation

npm install --save @mikosoft/echo

📘 Echo message format

Every log produces a standardized object:

{
  who: string,
  msg: string | object,
  method: 'log' | 'warn' | 'error' | 'objekt' | 'image' | 'question',
  time: string // ISO 8601 timestamp
}

💡 Basic example

const Echo = require('@mikosoft/echo');

(async () => {
  const echo = new Echo(true);

  await echo.log('App started');
  await echo.warn('Low memory');
  await echo.objekt({ service: 'DEX8', status: 'running' });
  await echo.error(new Error('Unexpected failure'));

  console.log('\nALL ECHOES:\n', echo.allEchoes);
})();

allEchoes

echo.allEchoes stores every emitted message, in order.

Useful for debugging, audits, exporting logs, and testing.

🔁 EventEmitter example (with questions)

const { EventEmitter } = require('events');
const Echo = require('@mikosoft/echo');

const emitter = new EventEmitter();
const WHO = 'user1';

const echo = new Echo(true, 10, emitter, 5000, WHO);

// listen to all echo events
emitter.on('echo-event', e => {
  console.log('EVT::', e.method, e.msg);
});

// answer the question
setTimeout(() => {
  emitter.emit('echo-answer', WHO, 'Continue? (yes/no)', 'yes');
}, 1000);

(async () => {
  const answer = await echo.question('Continue? (yes/no)');
  await echo.log('Answer received:', answer);
})();

⚙️ Constructor

new Echo(short, delay, eventEmitter, answerTimeout, who)

| Param | Type | Default | Description | | --- | --- | --- | --- | | short | boolean | true | Short console output | | delay | number | 100 | Delay between logs (ms) | | eventEmitter | EventEmitter | undefined | Emits echo-event | | answerTimeout | number | 30000 | Question timeout (ms) | | who | string | '' | Sender identifier |


🧾 Logging methods

All methods are async.

log(...args)

General info (green)

await echo.log('Hello', 123, { a: 1 });

warn(...args)

Warnings (yellow)

await echo.warn('Deprecated API');

error(err)

Errors (red)

await echo.error(new Error('Something failed'));

objekt(obj)

Pretty-printed objects (blue)

await echo.objekt({ a: 1, b: 2 });

image(base64)

Base64 image passthrough (gray)

await echo.image('iVBORw0KGgoAAAANSUhEUgAA...');

❓ Interactive questions

question(question) : Promise

Pauses execution until answered via EventEmitter.

const answer = await echo.question('Are you sure?');

Answer must be emitted like this:

eventEmitter.emit('echo-answer', who, 'Are you sure?', 'yes');

If no answer arrives within answerTimeout, the promise rejects.

📄 License

MIT

Author

Mikosoft