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

lognal

v1.0.0

Published

A terminal-style log viewer for the browser, drawn on a canvas. Mirror the console, read log files, and inspect typed values that expand and collapse.

Downloads

172

Readme

lognal for JavaScript

license npm latest package npm downloads run-test-js

lognal is a log viewer for web pages that looks and behaves like a terminal. It draws log output on a canvas instead of creating a DOM element for every line, so a fast stream of messages and a long history do not slow the page down.

This is the npm package. The Flutter package lives in packages/flutter, and the documentation for both is at lognal.cdget.com.

What it does

  • Shows the browser console inside your page. Hook console.log, console.warn, console.table, console.group and the rest. Arguments are captured at the moment of the call, and the original console keeps working.
  • Reads log files. Open a text file and read it line by line. The encoding is detected, including legacy encodings such as EUC-KR. In Chromium-based browsers, a file picked with the File System Access API can be followed as it grows.
  • Displays values by type. Objects, arrays, maps, sets, errors and DOM elements expand and collapse, and console.table draws a table.
  • Accepts commands. Connect a handler, and the viewer shows an input line and prints the replies.
  • Handles Korean and other CJK text. Wide characters stay on the grid, Korean text wraps at spaces, and Enter waits for IME composition to finish.

The viewer has a toolbar (follow new logs, clear, scroll to top and bottom, line wrapping, themes, hidden messages, text filter and level filter), a status bar, a search bar (Ctrl+F) that highlights matches without hiding entries, timestamps, links that open in a new tab after a confirmation, a menu on each entry for copying and expanding it, a mode that selects whole entries the way a file manager selects files, six color palettes that follow the operating system by default, and a custom scrollbar. Every part can be turned off or restyled with CSS custom properties.

Quick start

npm install lognal
import { LogViewer } from 'lognal';
import 'lognal/style.css';

// The container needs a height.
const viewer = new LogViewer(document.getElementById('logs'), {
	timestamps: true,
	core: { maxEntries: 20000 }
});

viewer.hookConsole();
console.log('Hello %s', 'lognal', { id: 1, tags: ['canvas', 'logs'] });

With React:

import { LogViewer } from 'lognal/react';
import 'lognal/style.css';

export const Logs = () => <LogViewer hookConsole style={{ height: 400 }} />;

Reading a file:

import { readTextFile } from 'lognal';

input.addEventListener('change', async () => {
	await readTextFile(input.files[0], viewer.store);
});

Entry points

| Specifier | What it is | | ------------------ | -------------------------------------------------------------- | | lognal | The viewer, the store, the layout and the sources. | | lognal/react | The LogViewer React component. react is a peer dependency. | | lognal/style.css | The stylesheet, required for the viewer to look like itself. |

Browser support

lognal targets current versions of Chrome, Edge, Firefox and Safari. A few features depend on newer platform APIs:

| Feature | Requirement | | -------------------------------------- | ------------------------------------------------------------------------------ | | Grapheme clusters for emoji and Hangul | Intl.Segmenter: Chrome 87, Firefox 125, Safari 14.1. A fallback is built in. | | Following a growing file | File System Access API, Chromium-based browsers only |

Development

npm install
npm run dev          # playground at http://localhost:5173
npm test             # unit tests in Node.js and browser tests in Playwright
npm run lint
npm run build

LOGNAL_TEST_BROWSERS=chromium runs the browser suite in one browser instead of three. See CONTRIBUTING.md for the project layout and the workflow.

License

MIT © CDGet. The character width tables are generated from the Unicode Character Database, whose license is included in src/core/text/unicode-width-data.ts.