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

@yyberi/logger

v0.0.3

Published

A lightweight wrapper around [pino](https://www.npmjs.com/package/pino) for structured, level-based logging in both development and production environments.

Readme

@yyberi/logger

A lightweight wrapper around pino for structured, level-based logging in both development and production environments.

Installation

npm install @yyberi/logger

Features

  • Root & child loggers keyed by service or module name
  • Automatic environment detection (NODE_ENV) for console pretty-printing in development and file-based logging in production
  • Customizable log levels via the LogLevel enum
  • ISO timestamps in production logs
  • Configurable log directory via the LOG_DIR environment variable

Usage

import getLogger, { LogLevel } from '@yyberi/logger';

// Root logger (defaults to service name '@yyberi/logger')
const logger = getLogger();

// Optionally set a specific service name:
const customLogger = getLogger('my-service');

// Set global log level
logger.setLogLevel(LogLevel.INFO);

logger.info('Application started');

// Create a module-specific child logger
const authLogger = logger.child({ name: 'auth' });
authLogger.debug('Checking user credentials');

Configuration

  • NODE_ENV=production

    • Logs to file at $LOG_DIR/app.log (defaults to ./logs/app.log) with level info and above
    • Outputs JSON with fields: timestamp, env, version, service, plus the log message
  • NODE_ENV not set or anything else

    • Logs to console with colors and single-line pretty printing
    • Ignores service and module fields in pretty output (shown as prefix)

API Reference

| Method | Description | | --------------------------------------------- | ----------------------------------- | | getLogger(serviceName?) | Get or create a root logger | | logger.child(bindings) | Create a child logger with metadata | | logger.setLogLevel(lvl) | Dynamically adjust log level | | logger.fatal(...), error, warn, info, debug | Log at the specified level |

Environment Variables

  • LOG_DIR — Directory where app.log will be stored (defaults to ./logs)
  • NODE_ENV — Determines production vs development behavior
  • npm_package_version — Automatically picked up from your package.json for metadata

Tips & Caveats

  • The logs directory will be created automatically if it does not exist.
  • Production logs are written asynchronously; buffered logs may be lost if the process exits abruptly.
  • The timestamp override yields ISO-formatted strings; no further configuration needed.

Keywords

log, logging, logger, pino, pino-pretty

License

This project is licensed under the MIT License. Feel free to use and modify as needed.