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

@simsys/logevent

v1.0.0

Published

Structured JSON log events for Node.js — drop-in stdout writer for systemd-journal → Loki pipelines

Downloads

386

Readme

@simsys/logevent

Structured JSON log events for Node.js, designed for systemd-journal → Loki pipelines (Grafana Alloy loki.source.journal). Every call writes one JSON line to stdout.

Intentionally minimal — a stable schema, a configured service name, and never-throws guarantees. No transports, no batching, no sampling. Loki and LogQL handle querying.

This is the Node lane of a three-SDK repo (Node, Python, Go) that all emit the same event envelope. Full documentation, including the shared schema and cardinality guidance, lives in the repository README.

Install

Not yet on the npm registry. Pin to a release artifact:

{
  "dependencies": {
    "@simsys/logevent": "https://github.com/Simmons-Systems/simsys-logevent/releases/download/node-v0.2.0/simsys-logevent-0.2.0.tgz"
  }
}

Requires Node >= 20. ESM only.

Usage

import { configure, logEvent, logError } from "@simsys/logevent";

configure({ service: "board-portal" });

logEvent({
  event: "auth.signin",
  user: "u_8f2c1a94",           // stable internal ID, not an email
  route: "/api/auth/callback/google",
  outcome: "success",
});

// In a catch block — extracts error_type/error_message/stack:
logError("db.query.failed", err, { route: "/api/shifts" });

Emits one JSON line per call:

{"user":"u_8f2c1a94","route":"/api/auth/callback/google","outcome":"success","ts":"2026-04-27T12:34:56.789Z","level":"info","level_code":2,"service":"board-portal","hostname":"bfr","pid":12345,"event":"auth.signin"}

Schema

Every emitted object includes ts, level, level_code, service, hostname, pid, and event. Library-set fields always win over caller-supplied keys of the same name, so payloads cannot spoof system metadata.

Level codes are debug=1, info=2, warn=3, error=4.

Configuration

configure() is the only function that throws. It rejects a missing, non-string, empty, or whitespace-only service, and a defaultLevel outside debug/info/warn/error. Nothing is mutated when configuration is rejected, and the service name is stored trimmed.

An invalid per-event level is not an error — it normalizes to the configured default, so a bad level never costs you the log line.

service defaults to "unknown", and logging before configure() emits normally rather than failing: a misconfigured bootstrap is exactly when logs matter most. Treat {service="unknown"} in Loki as a bug signal.

Sensitive data

This library preserves arbitrary caller fields verbatim and performs no redaction. Never log passwords, API secrets, private keys, tokens, session cookies, Authorization headers, or full request bodies. Prefer a stable internal user ID over an email address — logError() also copies error.message and the full stack into the event, and neither is guaranteed free of sensitive data.

License

MIT. See LICENSE.