🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@site-index/observability

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@site-index/observability

Observability utilities for site-index.

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@site-index/observability

Observability and logging utilities for site-index packages.

npm version Code Quality Code Coverage Socket

Repository README

Install

npm install @site-index/observability

Requirements:

  • Node.js >=22

When to use

Use this package when you want consistent warning/error formatting and logging behavior across site-index tooling.

Public exports

export { Logger } from "./domains/logger/logger.js";
export type {
  LoggerOptions,
  LogSink,
  LogWriter,
} from "./domains/logger/types.js";

Public API

class Logger {
  constructor(options?: LoggerOptions);
  configure(options: LoggerOptions): void;
  info(message: string): void;
  warn(input: string | Warning | Warning[]): void;
  error(error: unknown): void;
}

Types:

type LogSink = (message: string) => void;

type LogWriter = {
  info: LogSink;
  warn: LogSink;
  error: LogSink;
};

type LoggerOptions = {
  writer?: LogWriter;
  quiet?: boolean;
  verbose?: boolean;
};

Behavior

  • default writers:
    • info -> stdout
    • warn -> stderr
    • error -> stderr
  • quiet suppresses info logs
  • verbose includes error stack traces when available
  • warning input can be:
    • string
    • single Warning
    • Warning[]
  • warning formatting:
    • Warning: <message>
    • Warning: <filePath>: <message>
  • Zod errors are formatted as validation failures with issue lines

Example

import { Logger } from "@site-index/observability";

const logger = new Logger({ verbose: true });

logger.info("Building artifacts");
logger.warn("No site-index modules discovered");
logger.error(new Error("Build failed"));

Keywords

site-index

FAQs

Package last updated on 15 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts