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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nexload-sdk/logger

v3.1.0

Published

High-performance, structured, and type-safe logging for JS/TS apps — powered by pino, with pretty output, env-integration, security redaction, and Next.js-friendly wrappers.

Readme

@nexload-sdk/logger


Features

  • 🚀 Pino-powered: Super-fast, versatile logger with pretty print out-of-the-box
  • 🛡️ Redacts sensitive fields: Safe defaults for user/password/token/cookies
  • 🟦 TypeScript-first: All logging operations and wrappers are fully typed
  • 🌐 Environment-aware: Integrates @nexload-sdk/env for type-safe env config
  • 🔎 Structured logs: Timestamped, colored, and clearly formatted
  • ⚙️ Customizable: Configure log level, service name, extra fields easily
  • Next.js Friendly: withLogger() helper makes SSR/data fetch logging a breeze
  • 🧩 Composable: Use directly or via helper for operation tracking & perf

Installation

pnpm add @nexload-sdk/logger
# or
yarn add @nexload-sdk/logger
# or
npm install @nexload-sdk/logger

Quick Start

Basic Logger Usage

import logger from '@nexload-sdk/logger';

logger.info('Service started');
logger.warn({ user: 'bob' }, 'Potential issue');
logger.error(new Error('Boom!'), 'Something failed');

Advanced: Next.js/Operation Wrapper

Easily log SSR, API, or async operations — complete with structured timing and error tracking.

import { withLogger } from '@nexload-sdk/logger';

export async function getServerSideProps() {
  return withLogger({ route: '/home', type: 'get-data', functionName: 'getServerSideProps' }, async (timingShot) => {
    timingShot('start-db');
    // fetch DB...
    timingShot('done-db');
    return { props: { /* ... */ } };
  });
}

API Reference

Default export: logger

  • Fully-configured pino instance
  • Configured by env (SERVICE_NAME, LOG_LEVEL, ...), redact secrets by default
  • Pretty/clean terminal output

withLogger(options, fn)

  • Wrap sync/async code and get structured, perf-aware logs with automatic timing, error, completion logs
  • Parameters:
    • options: { route: string, type: "render" | "get-data", functionName? }
    • fn(timingShot) => T | Promise<T> - Call timingShot(name) in your code for granular timings
  • Returns: Promise<T>

Example error log

Logs errors with operation context:

await withLogger({ route: '/test', type: 'get-data', functionName: 'fetch' }, async () => {
  throw new Error('fail')
});
// Output: ... { route: '/test', functionName: 'fetch', duration: '12.00ms' } Operation failed Error: fail

Configuration & Environment

  • Uses @nexload-sdk/env for all env management
  • By default, loads all variables in $NodePreset (i.e. LOG_LEVEL, SERVICE_NAME, ...)
  • All sensitive fields like passwords/tokens/cookies are redacted from logs
  • Formatting and fields customizable via standard pino config

Best Practices

  • Use withLogger for every major SSR/data/op in Next.js projects: automatic timing & errors
  • Log structure, not raw strings: { userId, error } — better for search and alerts
  • Set sensible LOG_LEVEL via env for prod/dev/test

Contributing

  1. Fork this repo, create a feature branch (feat/name)
  2. Make your changes — ensure all types, tests, and lint pass
  3. Use commit messages of the format: feat(scope): your description
  4. Open a pull request (PR) — BugBot checks and feedback required

License

MIT © GecutWeb Contributors


Branding

Built by NexLoad SDK · Enabling modern, observable, and resilient applications with top-notch developer tools.