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

@concord-consortium/log-monitor

v1.0.0

Published

Real-time log event monitor sidebar with filtering and CSV/JSON export

Downloads

881

Readme

@concord-consortium/log-monitor

A real-time log event monitor sidebar for Concord Consortium applications. Displays log events as they fire, with filtering, expandable payloads, and CSV/JSON export. Supports light and dark themes.

Installation

npm install @concord-consortium/log-monitor

During development, use yalc for local linking:

# In the log-monitor repo:
yalc publish

# In the consuming app:
yalc add @concord-consortium/log-monitor

Usage

There are two ways to connect the LogMonitor to your app's logging:

Direct log wrapper

For apps that call log() directly (e.g., simulation models using @concord-consortium/lara-interactive-api):

import { log as originalLog } from "@concord-consortium/lara-interactive-api";
import { createLogWrapper } from "@concord-consortium/log-monitor";

const log = enabled ? createLogWrapper(originalLog) : originalLog;

Listener/subscriber

For apps with a centralized Logger that has a listener API or event emitter:

import { emitLogEvent } from "@concord-consortium/log-monitor";

Logger.registerLogListener((logMessage) => {
  const { event, ...data } = logMessage;
  emitLogEvent({ event, data, timestamp: Date.now() });
});

Rendering the sidebar

import { LogMonitor } from "@concord-consortium/log-monitor";

{enabled && <LogMonitor logFilePrefix="my-app-log-events" theme="dark" />}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | logFilePrefix | string | "log-events" | Prefix for exported CSV/JSON filenames | | theme | "light" \| "dark" | "light" | Color theme for the sidebar |

Exports

| Export | Type | Description | |--------|------|-------------| | LogMonitor | React component | The sidebar UI | | createLogWrapper | (originalLog) => wrappedLog | Wraps a log function to also emit to the monitor | | emitLogEvent | (entry: LogEntry) => void | Manually push an event into the monitor | | onLogEvent | (listener) => unsubscribe | Subscribe to log events (used internally by LogMonitor) | | LogEntry | TypeScript type | { event: string; data?: Record<string, unknown>; timestamp: number } | | LogMonitorProps | TypeScript type | Props for the LogMonitor component |

Integrations

See integrations.md for detailed integration guides with code examples for each Concord Consortium application:

  • hurricane-model / wildfire-model / flooding-model — direct log wrapper
  • activity-player — Logger/LARA Events subscriber (sees all embedded interactives)
  • question-interactives demo — postMessage subscriber (replaces console.log)
  • collaborative-learning (CLUE)Logger.registerLogListener() (100+ event types)
  • CODAP v3Logger.registerLogListener()

Development

git clone https://github.com/concord-consortium/log-monitor.git
cd log-monitor
npm install
npm test
npm run build

Demo

An internal demo app is included for developing and testing the LogMonitor component in isolation:

npm run demo

This starts a Vite dev server with a control panel that lets you:

  • Select payload size (none, small, medium, large) to test the payload viewer at different data volumes
  • Send events with short, medium, or long event names to test name layout/truncation
  • Set the number of events to send in a batch and the delay between them
  • Toggle light/dark theme

The demo is excluded from the published npm package ("files": ["dist"]) and from the library's TypeScript build.

Testing in a consuming app

To test changes in a consuming app locally:

npm run build && yalc push

Deployment

Every push to master triggers a GitHub Actions workflow that builds and deploys the demo app to S3.

Live demo: https://models-resources.concord.org/log-monitor/branch/master/

NOTE: Publishing to npm is a separate step. It is not automatically done as part of the deployment process.

Publishing

  1. Update the version constant in src/index.ts and version in package.json
  2. Run npm install to update package-lock.json
  3. Run npm publish to publish

The prepublishOnly script automatically runs the build before publishing.

Requirements

  • React >= 16.8 (peer dependency)
  • No other dependencies

License

Copyright 2026 (c) by the Concord Consortium and is distributed under the MIT license.