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

@darksol/logpilot

v1.0.2

Published

Zero-config function-level structured logging for JavaScript and TypeScript services.

Readme

logpilot

Zero-config function-level structured logging for JavaScript and TypeScript services.

npm version license: MIT node >=18

Why this exists

Most app logs are either too noisy or not structured enough to debug production issues quickly. logpilot wraps your functions and emits consistent events (args, duration, result/error, context) without forcing a logger migration.

What it does

  • Wraps sync/async functions with structured success/error events
  • Adds timestamps, duration, and function metadata automatically
  • Supports redaction of sensitive keys (password, token, etc.)
  • Offers global config + scoped child loggers
  • Includes Express/Fastify-compatible middleware helper
  • Can wrap object/class methods for bulk instrumentation

Quickstart

npm install @darksol/logpilot
import { pilot } from "@darksol/logpilot";

pilot.configure({
  level: "info",
  format: "auto",
  context: { service: "billing-api" }
});

const sum = pilot((a: number, b: number) => a + b);
const result = await sum(2, 3);

Real examples

import { pilot } from "@darksol/logpilot";

const getUser = pilot(async (id: string) => ({ id, role: "admin" }));
await getUser("u_1");

const reqLog = pilot.child({ requestId: "req-42" });
reqLog.info("request started", { route: "/users/:id" });
// Wrap methods on an existing object
class Service {
  getOrder(id: string) {
    return { id, status: "ok" };
  }
}

const service = pilot.wrap(new Service());
service.getOrder("o_100");

Config / options

| Option | Type | Default | Description | |---|---|---|---| | level | "debug" \| "info" \| "warn" \| "error" | "info" | Minimum log level | | format | "auto" \| "pretty" \| "json" | "auto" | Output format (auto picks pretty unless NODE_ENV=production) | | output | logger-like object | console | Destination with info/warn/error/debug/log or .write() | | redact | string[] | sensible defaults | Case-insensitive key masking list | | context | Record<string, unknown> | {} | Global fields merged into each event | | onError | callback | undefined | Hook invoked when wrapper/middleware catches errors | | silent | boolean | false | Disable log output entirely |

Architecture / flow

  1. pilot(fn) creates a thin wrapper around your function.
  2. On invocation, it captures start time + context.
  3. On success/failure, it emits one structured event with metadata.
  4. Formatter renders event as pretty text or JSON.
  5. Output is written to configured destination.

Benchmarks / perf notes

logpilot is intentionally lightweight (zero runtime dependencies). It adds small wrapper overhead from timing, serialization, and output I/O. For latency-sensitive paths, prefer JSON output and conservative payload sizes.

Limitations + roadmap

Current limitations

  • No built-in log shipping (expects host platform/collector)
  • Redaction is key-based (not full PII detection)
  • Middleware helper targets common Express/Fastify request shapes

Roadmap

  • Optional custom serializer hooks
  • Additional middleware adapters with typed helpers
  • Extended docs for high-throughput production setups

License + links