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

@very-coffee/hello

v1.1.2

Published

A type-safe utility for creating structured logging across multiple namespaces and environments in TypeScript applications

Downloads

24

Readme

@very-coffee/hello

A type-safe utility for creating structured logging across multiple namespaces and environments in TypeScript applications.

Features

  • Type-safe logging with namespace and environment level support
  • DEBUG environment variable support (similar to debug package)
  • Pretty printing in development
  • File logging support
  • Next.js compatibility mode
  • Configurable log levels
  • Object and formatted string logging

Installation

npm install @very-coffee/hello

Basic Usage

import { helloInnit } from "@very-coffee/hello";

const namespaces = ["app", "api"] as const;
const levels = ["info", "error", "debug"] as const;

const hello = helloInnit(namespaces, levels);

// Log messages
hello.app.info("Server started on port %d", 3000);
hello.api.error({ error: new Error("Failed") }, "Request failed");

Configuration

Basic Options

const hello = helloInnit(namespaces, levels, {
  prettyPrint: true, // Enable pretty printing (default: true in development)
  level: "debug", // Set minimum log level
});

File Logging

const hello = helloInnit(namespaces, levels, {
  file: {
    path: "./logs/app.log", // Path to log file
    level: "info", // Optional: minimum level for file logging
    prettyPrint: true, // Optional: enable pretty printing in file
  },
});

Next.js Compatibility

For Next.js applications, especially in edge runtime environments where worker threads aren't supported:

// In your logger configuration file (e.g., src/lib/logs.ts)
import { helloInnit } from "@very-coffee/hello";

const namespaces = ["app", "api"] as const;
const levels = ["info", "error", "debug"] as const;

export const hello = helloInnit(namespaces, levels, {
  disableWorkers: true, // Required for Next.js edge runtime
  prettyPrint: process.env.NODE_ENV === "development",
});

When using in Next.js:

  1. Always set disableWorkers: true to avoid worker thread errors
  2. The logger will automatically use synchronous logging in edge runtime
  3. File logging will use direct file streams instead of worker threads
  4. Pretty printing will work in development mode without workers

Combined Configuration

You can combine different options:

const hello = helloInnit(namespaces, levels, {
  disableWorkers: true,
  prettyPrint: true,
  file: {
    path: "./logs/app.log",
    level: "info",
    prettyPrint: true,
  },
});

Environment Variables

DEBUG

Control which namespaces and levels are enabled:

# Enable specific namespace and level
DEBUG=app:info

# Enable all levels for a namespace
DEBUG=app:*

# Enable specific level across all namespaces
DEBUG=*:error

# Enable everything
DEBUG=*

# Enable multiple patterns
DEBUG=app:info,api:error

# Disable specific namespaces
DEBUG=*,-api

LOG_LEVEL

Set the minimum log level:

LOG_LEVEL=debug  # Will show debug and above
LOG_LEVEL=info   # Will show info and above
LOG_LEVEL=error  # Will show only error

NODE_ENV

Controls default pretty printing:

  • development: Pretty printing enabled by default
  • production: Pretty printing disabled by default
  • test: Transport disabled by default

Advanced Usage

Custom Pino Configuration

You can pass any Pino options directly:

import { helloInnit, pino } from "@very-coffee/hello";

const hello = helloInnit(namespaces, levels, {
  // Any valid pino options
  timestamp: pino.stdTimeFunctions.isoTime,
});

Object Logging

// Log with context object
hello.app.info({ userId: "123" }, "User logged in");

// Log object directly
hello.app.debug({
  event: "cache_miss",
  key: "user_123",
});

Format Specifiers

Supports printf-style format specifiers:

  • %s - String
  • %d or %i - Integer
  • %f - Float
  • %o or %O - Object
  • %j - JSON

Example:

hello.app.info("User %s logged in from %s", username, ip);

License

MIT