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

neural-logline

v0.1.2

Published

A tiny local model that extracts timestamps, levels, sources, and messages from log lines.

Readme

neural-logline

A tiny local model that extracts the timestamp, severity, source, and message from an unfamiliar log line.

import { parse } from "neural-logline";

parse("2026-09-19T10:42:01.123Z ERROR worker failed to decode response body");
// {
//   timestamp: { text: "2026-09-19T10:42:01.123Z", ... },
//   level: { text: "ERROR", normalized: "error", ... },
//   source: { text: "worker", ... },
//   message: { text: "failed to decode response body", ... }
// }

CLI

Run one line without installing anything:

npx neural-logline "2026-09-19T10:42:01Z ERROR api request failed"

Or parse a stream as JSON Lines:

cat application.log | npx neural-logline

Why

Template miners such as Drain3 work best after structured headers have been removed. Existing log viewers commonly maintain regular expressions for each known timestamp and prefix. This experiment asks whether a very small model can provide a local fallback for unfamiliar plain-text prefixes.

The model handles the ambiguous token labels. Plain TypeScript assembles spans, normalizes levels, and enforces the rule that the message is a suffix. There is no server, inference framework, telemetry, or runtime dependency.

Scope

  • Plain-text, single-line logs
  • Timestamp, level, source, and message extraction
  • Node.js, Bun, workers, and modern browsers
  • Deterministic synthetic training and evaluation

Known structured formats should still use their exact parsers. The model is a fallback, not an RFC parser or a security boundary.

Development

Requires Bun 1.3 or newer.

bun run train
bun test
bun run evaluate
bun run build

The training script is dependency free and writes the reproducible weights to src/weights.ts. See MODEL_CARD.md for data, metrics, intended use, and limitations.

The current checked-in proof is in benchmarks/latest.json. bun run check reruns tests, evaluation, the production build, and a private-identifier scan. The CI workflow also retrains the model and verifies that the weight file is byte-for-byte reproducible.

Prior art

  • Drain3 mines templates from message bodies.
  • Loghub-2.0 provides a broader benchmark for template-mining research.
  • gpu-lexer demonstrated that a small local token classifier can be useful in the browser.

See docs/prior-art.md for the comparison and project boundary.

License

MIT