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 🙏

© 2025 – Pkg Stats / Ryan Hefner

eventbus-debugger

v1.0.0

Published

Debugger for native/browser events using a wrapper + log API

Readme

🧪 eventbus-debugger NPM version NPM downloads

Debugging frontend events shouldn't feel like playing hide-and-seek in the dark.

eventbus-debugger is a lightweight devtool that helps you see, log, and inspect all the JavaScript events firing in your app — clicks, inputs, scrolls, you name it — all with a single wrapper and a slick dark-mode dashboard.

Perfect for debugging pub/sub flows, tracking UI behavior, or just watching your app scream "help!" in JSON.


⚡️ Features

  • 🔍 Wraps native addEventListener with optional payload logging
  • 📤 Logs are sent to a local API and written to a file
  • 💻 Comes with a dashboard at /dashboard for visual inspection
  • ⏱️ Auto-refresh, filters by event type and timestamp
  • 🌑 Dark mode (because we care about your eyes)

🛠️ Installation

npm install eventbus-debugger

🧙 Usage: In Your Frontend Code

import { addEventListenerWithLog } from 'eventbus-debugger';

addEventListenerWithLog(
  document.getElementById('submit-btn'),
  'click',
  () => {
    console.log('Button clicked!');
  },
  false,
  { context: 'User clicked Submit', role: 'guest' } // Optional payload
);

🔧 It behaves exactly like addEventListener, but smarter.


🧠 What It Logs

Each log is stored like this:

{
  "type": "click",
  "timestamp": 1700000000000,
  "target": "BUTTON",
  "payload": {
    "context": "User clicked Submit",
    "role": "guest"
  },
  "receivedAt": 1700000000123
}

Saved to logs/events.log as newline-separated JSON.


🔥 Start the Logging Server

npx eventbus-debugger-server

Runs a tiny Express server on http://localhost:3456.

API Endpoints:

  • POST /api/log-event — for incoming logs (handled by the wrapper)
  • GET /api/event-logs — to fetch logs
  • GET /dashboard — your new favorite dark-mode dashboard

🌌 The Dashboard

Access it at:

http://localhost:3456/dashboard

Features:

  • 📋 Table of all events
  • 🔍 Filter by event type
  • 📆 Filter by date range
  • 🔄 Auto-refresh toggle
  • 🌑 Dark. Always dark.

Feels like a devtool, not a spreadsheet.


🧪 Example React Usage

import { addEventListenerWithLog } from 'eventbus-debugger';
useEffect(() => {
  if (ref.current) {
    addEventListenerWithLog(ref.current, 'click', () => {
      console.log('React click!');
    }, false, { source: 'React button' });
  }
}, []);

👀 Pro Tips

  • Logs are saved to logs/events.log by default
  • Want to wipe logs? Just delete the file or add a button for it
  • Want to ship this in production? Don’t — unless you're trying to build an audit trail , or ping me i have a secret sauce for you.

💡 Why?

Because console.log doesn’t scale, and events don't print themselves.


🧙 Author

Built by cinfinit — fueled by curiosity and a desire to make things better.